Commit Graph

49975 Commits

Author SHA1 Message Date
Jeffy Chen 68c4faa3f8 rockchip: mkimage: support packing optional second level boot-loader
Support packing optional second level boot-loader:

$ ./tools/mkimage -n rk3399 -T rksd -d \
  rk3399_ddr_800MHz_v1.24.bin:rk3399_miniloader_v1.19.bin out -v
Adding Image rk3399_ddr_800MHz_v1.24.bin
Size 116492(pad to 116736)
Adding Image rk3399_miniloader_v1.19.bin
Size 88060(pad to 88064)
Image Type:   Rockchip RK33 (SD/MMC) boot image
Init Data Size: 116736 bytes
Boot Data Size: 88064 bytes

Mainly parse init file and boot file from datafile option, copy them to
the image, and padding each one to 2KB boundary.

NOTE:
I don't know much about rknand.c, and there's no way to verify it now.
The output image is unchanged though (with a few extra padding).

Haven't got any feedback from upstream yet...But whatever, let's do this!

Change-Id: I0ce98a44634cfcd8acfe9a3e2cfbe3ee0107fba4
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2020-03-30 14:52:08 +08:00
Joseph Chen 96f5441ec8 common: fit: support spl fit image check by tools/fit_check_sign
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0e03a90d50290e18c6fb2cd44516c352f3695290
2020-03-29 09:57:04 +08:00
Joseph Chen 8e3eb57c1c rockchip: add arm 32/64 its file for verified-boot image
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If4d76b8736510ca6455a4b448e9d2ed1be5721fe
2020-03-29 09:57:04 +08:00
Joseph Chen bfbe87590f cmd: bootuimage: return -1 as error code
support autoboot to traverse all bootcmd list.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I03f10a5982c4a9bb0eee429f756dd19c027c3371
2020-03-28 18:25:32 +08:00
Joseph Chen e2c45c31e9 cmd: bootfit: return -1 as error code
support autoboot to traverse all bootcmd list.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibb35c20fb9ffcf58130aaeaea072c2dd6bc46256
2020-03-28 18:25:32 +08:00
Joseph Chen 9889a0e0a7 rockchip: hotkey: update configure name
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie04b4aa61900f11937f93b6a363ad827a8b7dd86
2020-03-28 18:21:16 +08:00
Joseph Chen 37526a5172 common: support disable CLI for verified-boot
Not allow any interactive from CLI.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I207da3f2c54df1a81100c404f045023ac763da73
2020-03-28 18:21:16 +08:00
Joseph Chen 4ab50248f6 rockchip: implement autoboot_command_fail_handle()
It's not friendly to handle the fail event in a bootcmd list,
let's handle this in C function.

Entering rockusb/fastboot mode after verified-boot failed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib617582e1cc386f5c30abe1a8bbd2b5f353c0e49
2020-03-28 18:21:16 +08:00
Joseph Chen 7fc773a76d common: add autoboot_command_fail_handle() callback
Maybe user need to do some job when bootcmd failed, they
could override it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1c32c1ad37700e66d45fe033fbfa46d3f350205d
2020-03-28 18:21:16 +08:00
Joseph Chen 96158db731 arm: rockchip: select CONFIG_PANIC_HANG
Not reset system.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I03b02fa0aada05dcea34a3e4609c68cc1b9cb029
2020-03-28 18:16:08 +08:00
Joseph Chen 5f14e3de56 include: rsa: fix compile error
Fix for: CONFIG_SPL_FIT_SIGNATURE && !CONFIG_FIT_SIGNATURE

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8242d208db14aa9066bb8c6d430686f909258844
2020-03-28 18:16:08 +08:00
Joseph Chen 4e07096a0b rockchip: fit: reserve LSB as an image identity number
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I917e89793aebc6a411ad7e4678b00e7f7b770e73
2020-03-27 18:08:12 +08:00
Joseph Chen ba2acfb819 rockchip: make_fit_atf.py: update conf@1 descrption and arch
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5eeb1b897508db1073b2ec63b9e28a895c1f417b
2020-03-27 18:08:11 +08:00
Joseph Chen 311b4dd629 rockchip: make_fit_optee.sh: add components for verified boot
Require sha256 and rsa2048 for all images to be signed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5c74f811fe5c49a2552a5a059c200a0d35f210cb
2020-03-27 18:08:11 +08:00
Joseph Chen 957222d7c6 common: image: support IMAGE_PARAM_INVAL as placeholder address flag
User maybe not want to set a fixed address, leave it to U-Boot.
This is a compatible method for different board and platforms.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I01accbc0f116856276610bfaea8de2f7e1275bb0
2020-03-27 18:07:52 +08:00
Joseph Chen 40d08d0f10 tools: mkimage: support pack empty file for multi image
Muilt image bootflow requires ramdisk as a mandory component,
so that we have to pack a empty ramdisk into multi image at
some time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I551ae832fbc68514ead0a3337148593e3113394f
2020-03-27 18:02:55 +08:00
Joseph Chen a86a723e2e rockchip: uimage: fix alloc and free ramdisk sysmem
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I84d965caff7c0d733792bcf2387d751808991c0d
2020-03-27 16:12:20 +08:00
Jianqun Xu 96a4cf48b5 power: io-domain: fix err handle for regulator get
Change-Id: I7c8d760676c15776df35708bf4d35552da0cf96b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-27 15:17:53 +08:00
Joseph Chen 594e14a437 common: spl: support enable D-cache for 32-bit platform
- Initial gd->bd->bi_dram[] for arm32.
- Add a configure to enable/disable SPL D-cache.
- Please make sure CONFIG_SPL_SYS_MALLOC_F_LEN is large
  enough for TLB and bd_t buffer while enabling dcache

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I85f2169fe44b44e16edb15a9538df516037e9823
2020-03-26 14:56:18 +08:00
Joseph Chen c155446281 rockchip: common: set CONFIG_NR_DRAM_BANKS for SPL
SPL don't need so many dram banks.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie4a48361bb4911466e58ba859ffb51dcb616fbbb
2020-03-26 14:52:31 +08:00
Joseph Chen 008ec9b4bc lib: rsa: add hardware crypto for FIT image checksum and rsa
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I526dd1b9a2a7e0050786f6006fd166f3dfb3a5c4
2020-03-24 21:00:32 +08:00
Joseph Chen c14e46abc4 dm: crypto: add API for multi regions checksum
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id364b123a189987458b72adca28f4f4e75e90291
2020-03-24 21:00:10 +08:00
Jason Zhu cc668fbca4 driver: Makefile: support PWM in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3ca97f634acae8c2d9de0b5e003776bccb14cd1b
2020-03-23 17:00:24 +08:00
Jason Zhu 2d7c904f27 driver: Makefile: support adc in SPL
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I915becbf9597aa070001d3368d8daf9079565fc9
2020-03-23 17:00:24 +08:00
Jason Zhu cd4d895a73 dm: key: isolate the unused irq code in spl
Since the irq is not planned to use in spl.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia6433f3d9c3b2cc9862ddff781b6fe71b3bec0f0
2020-03-23 17:00:24 +08:00
Jason Zhu 6c64f7fece power: fuel gauge: allow fuel gauge in SPL
Sometimes we need low power test in spl. Update the config
to allow this.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0c7d035cb55e06980d1c2fd28ceef5adee4d7197
2020-03-23 17:00:24 +08:00
Simon Glass f4462f85e6 UPSTREAM: spl: input: Allow input in SPL and TPL
In some cases it is necessary to read the keyboard in early phases of
U-Boot. Update the config to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0f166e55c84c9f10ced9e4580e6b7c7a6f980a79
2020-03-23 17:00:24 +08:00
Joseph Chen 909b972800 cmd: net: support tftp/tftpbootm/tftpflash commands
- tftp: download image.
- tftpbootm: download and bootm the aosp/uImage/FIT Image.
- tftpflash: download and flash the Image to partition.

rename "tftpboot" to "tftp" since there are so many tftpxxx commands,
the "tftp" cmd can't be recoganize as "tftpboot" by CLI shell.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0128cd41a8fc9105016ae0417241348eb4a6f637
2020-03-19 09:58:11 +08:00
Joseph Chen a1b6bf655e rockchip: common: add "boot_fit" and "boot_uimage" to bootcmd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I98845b9e57be4183e079e18c20f9f2e0a27ffac3
2020-03-19 09:54:27 +08:00
Joseph Chen ac5d8aa9aa rockchip: board: implement board_do_bootm()
Implement it to support CLI command:
  - Android: bootm [aosp addr]
  - FIT:     bootm [fit addr]
  - uImage:  bootm [uimage addr]

Purpose:
  - The original bootm command args require fdt addr on AOSP,
    which is not flexible on rockchip boot/recovery.img.
  - Take Android/FIT/uImage image into sysmem management to avoid image
    memory overlap.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4ef3f1b0307f2e061105ee29307051202445c9e9
2020-03-19 09:54:27 +08:00
Joseph Chen 7460c07a1d common: android: simplify fdt/ramdisk skip reloc
bootm_board_start() takes over it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8a9e3287ad5ca5964809f689bd204cbc2e37468f
2020-03-19 09:54:27 +08:00
Joseph Chen 5cadaea8d7 common: android: replace do_bootm() with do_bootm_states()
Avoid dead nested when android_bootloader_boot_kernel() is called
in board_do_bootm(), this bootflow maybe:

CLI command "bootm" => do_bootm() => board_do_bootm() =>
android_bootloader_boot_kernel() => do_bootm().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I441d91c986921008752d403a72b7bfa57140d7c8
2020-03-19 09:54:27 +08:00
Joseph Chen a4696473d2 cmd: bootrkp: simplify fdt/ramdisk skip reloc
bootm_board_start() takes over it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie1df21ee3ff929a5fa7163216d90315277f6cfd5
2020-03-19 09:54:27 +08:00
Joseph Chen 85cad72d55 rockchip: board: implement bootm_board_start()
- print console record data;
- disable fdt/ramdisk relocation;

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If8c2008e04c57e0309dbb5d679a21cb7d435d4ff
2020-03-19 09:54:27 +08:00
Joseph Chen e39c2b5d45 cmd: add "boot_uimage" command for legacy uImage
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie7b55ff4f63957312895c0f57fd405d3389f2ad7
2020-03-19 09:54:27 +08:00
Joseph Chen 72c88b4aea cmd: add "boot_fit" command for FIT image
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I09f936cf5cefb0b9f2334a6590b5dfb4d85151a3
2020-03-19 09:54:27 +08:00
Joseph Chen c5b2395492 rockchip: support read kernel from fit and uimage
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If77ffadc81bb3a53789d74f3185aa6f1650ee0e7
2020-03-19 09:54:27 +08:00
Joseph Chen 191c6877bc rockchip: add basic uimage code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idaf6d9e1888fde4e750435a0484636945442cbe2
2020-03-19 09:54:27 +08:00
Joseph Chen 059c50ac0b rockchip: add basic fit image code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic0eaba1b625eba710fd6b30fee4e3545af59cb30
2020-03-19 09:54:27 +08:00
Sandy Huang 2d7c136f03 drm/rockchip: add support one crtc multi connector pattern
some rockchip Soc platform just like rk3368, only have one crtc and
multi connector, we must consider the following pattern:
1. only connect lcd panel
  -> show logo at lcd panel
2. connect lcd panel and hdmi, and the resolution is different
  -> show uboot logo at mipi panel
     -> show kernel logo at mipi panel
       -> show android logo at hdmi panel
3. connect lcd panel and hdmi, and the solution is same.
  -> show logo at lcd panel and hdmi panel at the same time,the path is:
     crtc -> hdmi->hdmi panel
         |-> mipi/edp/... -> lcd panel

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I7fb8452ddd128ba70ba18f288500e71c1f03ca8b
2020-03-18 16:27:28 +08:00
Sandy Huang 4927c43eb7 drm/rockchip: delete unused and repeated call
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I281e4fe6834273a10b7c289128173aff32ec4125
2020-03-18 16:25:32 +08:00
Joseph Chen ebe917bdf9 dm: serial: hide and present pinctrl prop in live device tree
1. We bind all serial nodes including UART debug node from kernel dtb.
2. On some rockchip platforms, UART debug and SDMMC pin are multiplex.
   Without this, iomux is switched from SDMMC => UART debug at this time.
3. We may switch to UART debug iomux after SDMMC boot failed to print log.

fixes: (503458d core: device: allow serial node bind from kernel dtb)

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I286ad49f6c5a7e083d205560a4a16e16ded6b83f
2020-03-17 08:53:22 +08:00
Joseph Chen 05e0f98eb3 driver: core: add dev_del_prop() api
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id016f2f3e2d4d80a7dbd72d02a038c07b3a0de26
2020-03-17 08:53:09 +08:00
Joseph Chen 45390edfba rockchip: resource: optimise code
- clean init_resource_list();
- support create resource list and read file from memory

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If308c1dc6f43d0250d81cfa6fb0898d59efe8975
2020-03-16 15:03:51 +08:00
Joseph Chen 3fe16d468f arm64: interrupts: show ESR register for SPL
It contains the exception reason.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibcd381979dccb0dd17b5b8899053cb0c5cd22a96
2020-03-16 15:03:50 +08:00
Joseph Chen 1d0e326571 configs: rk3399: enable spl fit signature
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I94f4f331df8d672207a4afcecc4af59277aa50bf
2020-03-16 11:42:38 +08:00
Joseph Chen 75efda7622 configs: rk3399: update with make savedefconfig
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If5da2f21b5d492f5aa94f5458aea3cf660093a10
2020-03-16 11:42:38 +08:00
Joseph Chen 53f956c218 rockchip: make_fit_atf.py: add components for verified boot
Require sha256 and rsa2048 for all images to be signed.

Use u-boot.dtb to be included as fdt component since the
u-boot.dtb contains the "/signature" information of U-Boot
proper.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1a3ac5f323730b7ef52afd883110d41179740f4f
2020-03-16 11:42:38 +08:00
Joseph Chen 583377c459 spl: fit: add fit config verify support
Do fit config verify if required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I211f43c07d636ea8cff42cf9133bcab0aa86f8c6
2020-03-16 11:42:38 +08:00
Joseph Chen 3a183b396d tools: image-host: support add all images of sub list into hash list
Like the image list assigned by "loadables" = ...

configurations {
	default = "config@1";
	config@1 {
		...
		loadables = "uboot@1", "atf@2", "atf@3";
		signature@1 {
			algo = "sha1,rsa2048";
			key-name-hint = "dev";
			sign-images = "fdt", "firmware", "loadables";
		};
	};
};

Assuming the maximum sub image count is 5.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0454f6ad108342b5d85e831f7920baac642fb01a
2020-03-16 11:42:38 +08:00