Commit Graph

572 Commits

Author SHA1 Message Date
Joseph Chen 94cf1096ee power: charge animation: fix cmd compile error
cmd depends on DM_CHARGE_DISPLAY and default y.

Change-Id: I5e685e0020c4aa1da80ffc27e5a576bc8969c3be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-30 11:38:48 +08:00
Joseph Chen 6213b40154 cmd: CMD_DTMIG: select OF_LIBFDT_OVERLAY
Change-Id: I67d7040d477712169c815273dfaf913a4cf258e7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-30 10:41:57 +08:00
Joseph Chen c5449fd30c dm: dvfs: don't print fail message when there is no device
Change-Id: I8ec8920972261e8009dfd9306d8ab898460a71df
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-27 08:59:47 +08:00
Joseph Chen 6e15146eff lib: sysmem: refactor code
- import memblk id to manage memory blocks;
- change "sysmem_property" to generic "memblock";
- use alloc instead of reserve for all memory blocks;
- clean up and fix some logic;
- add U-Boot cmd for sysmem;

Change-Id: I614223ce3bf97a7b3566412a9d1864fb30b68fd8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Shunqian Zheng 957c1cf2af usb: rockusb: Forbid data beyond 32MB reading
Simply return magic char if one is trying to read data beyond 32MB.

Fixes: 628c827 ("usb: rockusb: forbid reading data beyond addr 32MB")

Change-Id: If2cdf05dbf9d6dcdd4cf8f9605ab84480fbca32d
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-03-14 19:24:48 +08:00
Andy Yan 4701d790f4 cmd: bootrkp: return CMD_RET_FAILURE on error
A cmd only returned with CMD_RET_XXX defined
by command_ret_t can ensure it work well when
called from shell.

Change-Id: I16e76ed62928380eaaf3c352efb4df9463b7e72d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-03-08 16:50:55 +08:00
Hisping Lin f4e1db9544 lib: optee_client: add judgment of return value
Change-Id: If616f89ffb2c3ea30afb7bced56a1ca28b1232b2
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-03-06 18:44:39 +08:00
Jason Zhu 562a66d432 cmd: fastboot: test the fastboot memory space availability
Use the sysmem to test fastboot memory is available or not.

Change-Id: I021152827b6948fabd5ea41e111ea20adf43167f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-05 11:19:41 +08:00
Jason Zhu 628c827194 usb: rockusb: forbid reading data beyond addr 32MB
Forbid reading data beyong addr 32MB to protect user data & firmware. Excess
partial is filled with 0xcc. The addr 32MB is quoted from pre-loader.

Change-Id: I96f4fb3bb0d88a309fef20650863011cd9f0dfd9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-02-25 17:14:46 +08:00
Jason Zhu b68be486b3 cmd: optee: remove write data to efuse
Preventing customer misoperation causing efuse unused.

Change-Id: Ie0fc3e5d73fb005d73beb0c035580ca13b9b3ba1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-02-25 09:01:35 +08:00
Joseph Chen deebadb707 cmd: fastboot: print mode state
This avoids user misunderstanding the system is hang
when enter fastboot mode without any warning message.

Change-Id: Ie6238c825342c8e322b2a5be746e4bba020e1ec9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-19 11:51:02 +08:00
Tang Yun ping a492b30692 cmd: ddr_tool: update ddr tool to version 1.01
Change-Id: I05ffb164dfa6bb8aa997ab5783c274215dc938f5
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2019-02-15 11:34:03 +08:00
Tang Yun ping fa65566613 cmd: memtester: fix print available address bug
Available address for testing may start from 0x00.

Change-Id: If3468c11a096c55cf7fff93dff0034679791b3a9
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2019-02-15 11:34:03 +08:00
Tang Yun ping d0c76e678b cmd: memtester: add each DQ mask function
Fix DQ to exact level when doing memtester by argument fix_bit and
fix_level.

Change-Id: I4b67b5e499f3e0c4d500d658bc05574f5e50543a
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2019-02-15 11:34:03 +08:00
Hisping Lin df99e5808c cmd: add test case for secure storage
1.mmc testsecurestorage to test secure storage
2.test secure storage in rpmb and test secure storage in
  security partition when use emmc
3.test secure storage in security partition when use nand

Change-Id: Id6f72893c002c5040cb1790051c9685911878df7
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-02-14 19:58:09 +08:00
Kever Yang 620cb65601 cmd: rbrom: fix to fit the MACRO SCOPE
Both cmd and its implement shoud be in the same MACRO.

Change-Id: I93587c425f999d9701d88b1d278fcc2a70d64133
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-02-13 16:43:46 +08:00
Jian Qiu c2ba77d93f lib: optee_client: Extract keymaster CA module
Extract keymaster CA module from OpteeClientInterface
refactoring code for keymaster reads and writes form caller module

Change-Id: I1069fce0d29d9d9815f71e7f3b4d231754382acd
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
2019-01-18 09:09:34 +08:00
Tang Yun ping c337a3c2b1 cmd: memtester: add test mask for test stuck address
Change-Id: Icbcf7e460befcc098c45e4e3efb7fb3c1bcb73a0
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2019-01-15 17:38:18 +08:00
Joseph Chen c0b4a82d39 cmd: nvedit: add "0x" prefix for hex value
Change-Id: Idab53a89d363a9fae6bf3aa98c99f9ba246e5ff9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-14 14:57:26 +08:00
Tang Yun ping d4eae7f5fe cmd: memtester: move some common code to ddr_tester_common.c
1. Moving some common code to ddr_tester_common.c to share with ddr tool.
2. io_map.c get dram bandwidth by using get_ddr_bw().

Change-Id: I90641f35c4474846a2357f4959415bfaa6230769
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2019-01-11 15:16:57 +08:00
Tang Yun ping 3e19306671 cmd: memtester: add cpu data to io remap
Change-Id: Ia9e2e6014c162cc929f5cbcb1559c91245c273bd
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2018-12-27 20:25:50 +08:00
Tang Yun ping 614eb1970c cmd: memtester: fix dram bandwidth to 32bit
For all rk chip, bandwidth is 32bit. Fix to 32bit to improve test
effect.

Change-Id: I4b7f2f3722d6c820886bec46179badc73719496a
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2018-12-27 20:25:50 +08:00
Tang Yun ping 3decc73706 cmd: ddr_tool: add ddr test tool code
RK3328/RK3326/PX30: enable CONFIG_OF_LIVE, CONFIG_ROCKCHIP_DMC and
CONFIG_CMD_DDR_TEST_TOOL.
RK1808/RK3399pro npu: enable CONFIG_CMD_DDR_TEST_TOOL.
When enable, it will create a 'ddr_test' command for user in U-Boot shell.

Change-Id: Iaa286e461d53b1caa4bcc069d37a7aad16a3e5e3
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2018-12-27 20:25:50 +08:00
Masahiro Yamada 0e00a84cde UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.

This commit moves the header code:
  include/libfdt.h         -> include/linux/libfdt.h
  include/libfdt_env.h     -> include/linux/libfdt_env.h

and replaces include directives:
  #include <libfdt.h>      -> #include <linux/libfdt.h>
  #include <libfdt_env.h>  -> #include <linux/libfdt_env.h>

Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +08:00
Joseph Chen 0eea0d250e dm: add dvfs uclass and wide temperature dvfs support
- add dvfs uclass;
- add dvfs command;
- add a simple wide temperature dvfs driver.

About wide temperature dvfs driver policy, see description in:
drivers/power/dvfs/rockchip_wtemp_dvfs.c

Change-Id: I36a8de6e47f8375bf1795b794c77d96b4571a361
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 18:03:51 +08:00
Jason Zhu fc1a55637d rockush: add serialnumber to usb_device_descriptor
Change-Id: I498be22dd73ffa8e8844bd9ceedb294b5bba72ce
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-11-23 11:06:51 +08:00
Joseph Chen ee465021fe android: support boot images packed with rockchip android hdr
For some legacy reasons, rockchip use mkbootimg tool to pack android
images with special pack parameters(SDK version lower than 8.1) to
assign kernel/ramdisk/seconds address and page size.

Android hdr on RK3399 SDK-7.1:
   kernel size:      1299808
   kernel address:   60408000
   ramdisk size:     1e6b80
   ramdisk addrress: 62000000
   second size:      41c00
   second address:   60f00000
   tags address:     60088000
   page size:        4000
   header_version:   0
   os_version:       e041114 (ver: 1.7.2, level: 2017.4)
   name:
   cmdline:          buildvariant=userdebug

The kernel/ramdisk/seconds address base is not from 0x10000000 and
page size is not 0x800!

This patch makes bootflow to compatible with above legacy packing.

Change-Id: I663a0d1386694658c97586706ff21ed887d6a2e7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-01 08:42:27 +08:00
Kever Yang d61082e9df cmd: part: use MAX_SEARCH_PARTITIONS for part search
Use Macro instead of hard code.

Change-Id: I8a41a762bb16ca77816871b357ededdde0b1c875
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-09-10 11:16:25 +08:00
Tang Yun ping 133266d48d cmd: add memtester code
Enable memtester by config CONFIG_CMD_MEMTESTER=y

Change-Id: I02c873a8b3be5ee3c9a1cf347b7e3e75cb5336f0
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2018-08-10 17:45:13 +08:00
Joseph Chen f81a9e78e7 env: fix env_exist/append/update() words match issue
solve some words match mistakes due to strstr().

Change-Id: I79ca9bc9ed1e9aeb5472e158650890023afa3da3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-08 11:53:05 +08:00
Sam Protsenko 2967d2f74d FROMLIST: cmd: Add dtimg command
dtimg command allows user to work with Android DTB/DTBO image format.
Such as, getting the address of desired DTB/DTBO file, printing the dump
of the image in U-Boot shell, etc.

This command is needed to provide Android boot with new Android DT image
format further.

Change-Id: I2a626f333f604b6f0424aa03feaddab4e8506a3f
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
(am from http://patchwork.ozlabs.org/patch/925871/)
2018-08-06 11:15:19 +08:00
Dingqiang Lin aa16b1f803 cmd: rksfc: change dev if_type
1.In rkflash driver, SPI Nand and SPI Nor are registered as two
different if_type
block dev. They are both the child_dev of sfc;
2.Here we send cmd to "rksfc" to operate it's child-dev spi flash device.

Change-Id: I9314ef9c556f8cfbe023021bd66bebec137a4e71
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-31 14:51:32 +08:00
Kever Yang 2bbf102863 cmd: mmc: do not force init HW in 'mmc dev' cmd
This is a revert to :
a5710920b7 cmd_mmc: make mmc dev always re-probe the HW

For emmc device, we should not re-init the HW with 'mmc dev' cmd,
please use 'mmc rescan' when need HW re-init.

Change-Id: I994d12beb7215db568e7a0ed58be3e36dfda5744
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-07-19 10:18:48 +08:00
Jason Zhu cc527546d3 androidboot: nodify cmd bootavb
1.printf necessary information
2.delete useless function: do_avb_write,
    do_avb_write_ab_metada

Change-Id: I5f932e7774ecf9b383358b3c081369cdc7db0167
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-07-19 09:57:37 +08:00
Jian Qiu 65413a00f9 fastboot: add FASTBOOT_OEM_UNLOCK option
This enables the following fastboot commands:
  fastboot oem unlock
  fastboot oem unlock_accept
  fastboot oem lock
  fastboot getvar oem-unlock

Android 8.1 need the oem unlock status attach to bootargs on boot.

Change-Id: Icc83451336a4dea2cbcf4927287de23bc8e28cb1
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
2018-07-19 09:56:14 +08:00
Andy Yan 008aee876a boot_android: add runtime compatible for un/compressed kernel image
This patch add auto parse the compress format of kernel image.
Then decompress the compressed kernel image for arm64, as for
arm32 zImage, we only need to load it to a higher memory, then
the kernel will handle the decompress itself.

Test on RK3308 AARCH64 mode (Cortex A35 816 MHZ) boot with eMMC:

------------------------------------------------------------------
Format    |  Size(Byte) | Ratio | Decomp time(ms) | Boot time(ms) |
-------------------------------------------------------------------
Image     | 7720968     |       |                 |     488       |
-------------------------------------------------------------------
Image.lz4 | 4119448     | 53%   |       59        |     455       |
-------------------------------------------------------------------
Image.lzo | 3858322     | 49%   |       141       |     536       |
-------------------------------------------------------------------
Image.gz  | 3529108     | 45%   |       222       |     609       |
-------------------------------------------------------------------
Image.bz2 | 3295914     | 42%   |       2940      |               |
-------------------------------------------------------------------
Image.lzma| 2683750     | 34%   |                 |               |
-------------------------------------------------------------------

Note: the boot time is counted from first ddr init log to first Kernel log.

Change-Id: I73b12ec944fbc8238b0e061a37e2f31aa3093231
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-07-14 11:39:04 +08:00
Joseph Chen 00129fb35e env: add env_update_filter()
provide ignore option to filter unused key words from a
list of new string which is ready to be appended.

Change-Id: I82d61ee21ec658e73549de42ad94ed259582cb7a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-09 14:18:03 +08:00
Jason Zhu 6651d4c0fb dev_desc: judge dev_desc whether NULL or not before use it
Change-Id: I9d0e2d207a143a02949fbdff2d9ad39f154e4f3e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-07-04 09:31:05 +08:00
Dingqiang Lin 300175f79e cmd: rknand: add rockchip spi nand u-boot command support
Change-Id: I8e3e6bab2d419b5fe0ab35c3985d1ff88efc5778
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-06-14 11:06:55 +08:00
Hisping Lin 69285f9ef7 cmd: mmc: remove test vboot hash code
trusty_write_vbootkey_hash will set secure boot flag
when we write vboot key hash success, we should remove it

Change-Id: I7b45739918b10b6847a7f5bf6b7c740f3b802870
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-06 09:19:41 +08:00
Dingqiang Lin d5f538dc02 cmd: rksfc: add sfc u-boot command
rksfc driver with block interface

Change-Id: I395cf78e939ce9ddbd07a9afad794474f0482542
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-05-11 11:08:38 +08:00
Jason Zhu 3671d25201 cmd: bootrkp: fix check blk_dread return value error
Change-Id: Ib283c2eeb982479914f8c806f7b54bf081f4c9be
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-05-08 16:02:43 +08:00
Kever Yang 6caa033365 rockchip: add rkimgtest cmd to get boot dev
We need to check if the storage(sdmmc) have IDB data so that
we can use it as boot device.

Change-Id: I7373b8f1a6c4c41c1d2cb1c94cd5d20c0780b5db
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-05-08 11:20:43 +08:00
qiujian 9e68721b27 bootargs : read oem unlock status
Read oem unlock status from optee_client api
and attach it to bootargs

Change-Id: Ib8b1a9bc115ec9cb7e5ce09dc50845cfd7c1c81b
Signed-off-by: Qiu Jian <qiujian@rock-chips.com>
2018-04-03 10:30:56 +08:00
qiujian f61a997e29 fastboot: implement oem unlock commands for bootrkp
Read-write oem unlock status from optee client api.

Implement the following fastboot commands:
  fastboot oem unlock
  fastboot oem unlock_accept
  fastboot oem lock
  fastboot getvar oem-unlock

Change-Id: I99edcee7b60c6d9529e6687291d87f22bf97b771
Signed-off-by: Qiu Jian <qiujian@rock-chips.com>
2018-04-03 10:30:56 +08:00
Andy Yan 4715d15e17 cmd: sf: add test count
Change-Id: I06c0783998152ef5d32f95f6813d5dfe315b4cc2
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-03-22 08:55:24 +08:00
Andy Yan a3d7c00b32 cmd: boot: add brom cmd to reboot to brom dnl mode
Change-Id: I797491ebe25af1013732aeee87e61e3ba4bc1689
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-03-22 08:55:24 +08:00
qiujian 91c73fb4d1 lib: optee_client:Support attestation
Add methods to read attestation key from the misc partition of
 last 64K, store key and certificate chain data in secure storage.

 When CONFIG_OPTEE_CLIENT is defined,
 uboot support load attestation data.

Change-Id: I8f3bd7096a7856de9e58d294822a818d5fe380ba
Signed-off-by: qiujian <qiujian@rock-chips.com>
2018-03-21 16:38:08 +08:00
Jason Zhu d9d5eb7401 androidboot: add cmd bootavb perm_attr_test
Read and print the perm_attr.

Change-Id: I1e2b73afa1e872eea7abf75d55570b1c8b19c311
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-07 08:59:46 +08:00
Jason Zhu 326572ea3b androidboot: fix compile error in arm64
Change-Id: I68bff703ffbf8ef9a65e4d62a5cf1052bc49ac9b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-05 11:34:47 +08:00