Commit Graph

16911 Commits

Author SHA1 Message Date
Joseph Chen 09f4e561ac android: update android image header to support new version
mainly to support android P.

Change-Id: I34a49e4eedcde06a9e40792c7c908737dc10b426
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-06 11:15:19 +08:00
Sam Protsenko e91b3373a9 FROMLIST: common: Add support for Android DT image
Android documentation recommends new image format for storing DTB/DTBO
files: [1]. To support that format, this patch adds helper functions for
Android DTB/DTBO format. In image-android-dt.* files you can find helper
functions to work with Android DT image format, such us routines for:
    - printing the dump of image structure
    - getting the address and size of desired dtb/dtbo file

This patch uses dt_table.h file, that was added in 643cefa4d848 ("Import
Android's dt_table.h for DT image format") by Alex Deymo.

[1] https://source.android.com/devices/architecture/dto/partitions

Change-Id: I78f6750af6c4fecb80d331bc06bc5cbe98da5825
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/925870/)
2018-08-06 11:15:19 +08:00
Alex Deymo 7ec0ac2b36 UPSTREAM: Import Android's dt_table.h for DT image format
Android documentation defines the recommended image format for storing
DTB/DTBO files in a single dtbo.img image. This patch includes the
latest header file with the struct definitions for this format from
AOSP.

The header was adapted to U-Boot's coding style and the function
declarations were removed.

Change-Id: I4d3a452b600a6908f4b720b6e6c926c918be5630
Signed-off-by: Alex Deymo <deymo@google.com>
[trini: Change SDPX tag location]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
(cherry picked from commit 643cefa4d848a9358951caab42b5f9cd15e4fb5f)
2018-08-06 11:15:19 +08:00
Elaine Zhang efb944b698 rockchip: clk: rk3128: support more clks to set and get rate
Make clock ids consistent with kernel.
support more clks to set and get rate.
add clk init.

Change-Id: I1e6b5734887e0bd5d845f1286f10eb0e3e42bc08
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-02 17:03:55 +08:00
Elaine Zhang 809e91fd38 rockchip: clk: rk322x: support more clks to set and get rate
Change-Id: Ibed40f1826469263a8015d8af2dea4d3567a08e6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-02 17:03:55 +08:00
Elaine Zhang 0b7db90f19 rockchip: clk: rk3328: support more clks to set and get rate
Change-Id: Ic231b7701c6eb23b0e9db21c1d28fb4d08c4debf
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-08-02 17:03:55 +08:00
Dingqiang Lin 3872c3f472 drvers: block: blk-uclass: add SPI Flash blk devices
1.Add SPI Flash blk devices;
2.Remove unused RKSFC blk devices.

Change-Id: I0c570798875b4dddf7dfc651f992d2e8eb725228
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-31 14:51:32 +08:00
Dingqiang Lin 3f360b7931 rockchip: bootcmd: change rksfc to spi flash devices in bootdev
1.Under the control of sfc, SPI Nand and SPI Nor are registered as two
different if_type block dev and are both the child_dev of sfc:
	a.Dev 0: blk_dev "rkflash", devenum 0, if_type SpiNand
	b.Dev 1: blk_dev "rkflash", devenum 1, if_type SpiNor

Change-Id: Iaa90fdc5c0926495c989189b9ef9e317b70f23a4
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-31 14:51:32 +08:00
Joseph Chen 68995a9bef dm: key: remove deprecated platform_read_key()
Change-Id: I88af911581b94f59504124786cb1adaa82dae12f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:21:21 +08:00
Joseph Chen 64048c537e dm: key: optimise framework and update drivers
1. dm key framework takes over more generic jobs;
2. key drivers remove unused codes and match new framework;
3. only power key is registered as interrupt key;

Change-Id: Icdda86f588af721b685f801ed251581f2fd85793
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:20:43 +08:00
Joseph Chen 99b8866017 rockchip: evb_rk3229: remove unused configure
Change-Id: Ifcea5ff63d0a68d3ca6a327bbd216da7e4a7b842
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 11:36:56 +08:00
Joseph Chen b8f8ff5155 rockchip: rk322x: add RKIMG_DET_BOOTDEV
Change-Id: I92512be99439f926fa86df956e23eae6bce94109
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-19 21:04:18 +08:00
Joseph Chen 9bfe736ccb rockchip: rk322x: enable vidconsole
Change-Id: I6ab5fd0232ed61578f958b2371ebef87caa10c5b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-19 21:04:17 +08:00
Joseph Chen 51117ff49b rockchip: rk3328: enable vidconsole
Change-Id: I5eebb1e10fe2fac7c3e0cec1884cd1c121fa9587
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-19 20:45:19 +08:00
CanYang He ab83a6fe58 debug_uart: add a printdec() to print decimalism result
some value use decimalism to print is more readable for user, for
example: frequency, capacity

Change-Id: I9fa2a68d30c7694a582167d2d8767e18e28a9e83
Signed-off-by: CanYang He <hcy@rock-chips.com>
2018-07-19 09:57:48 +08:00
YouMin Chen 846371a2e8 rockchip: px30: spl: fix spl compile error
fix spl compile error about defined CONFIG_BOOTCOMMAND.

Change-Id: I0a16e50f2f0ea8c283aa43ed78c7264e910ed4a8
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-07-18 18:03:52 +08:00
YouMin Chen 4d65b3b352 rockchip: px30: spl: change CONFIG_SPL_MAX_SIZE to 0x20000
px30 spl size over 0x10000,so set CONFIG_SPL_MAX_SIZE to 0x20000.

Change-Id: I3e9bea5ccb7d4516ecc4881eb2d454e1afdcabb0
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-07-18 18:03:52 +08:00
YouMin Chen ba5fd738de rockchip: tpl: rename CONFIG_TINY_TPL to CONFIG_TPL_TINY_FRAMEWORK
Change-Id: Ia05a73467578f5620a9ba168e67bcfb02c40e1d0
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-07-18 17:09:38 +08:00
Joseph Chen 737e12167d rockchip: add iomem show interface
this is mainly for debug.

Change-Id: Ied842841f09780c11092624fb602a3f3723469c3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-18 16:33:02 +08:00
Andy Yan 366357ca8d include/config_fallbacks.h: add CONFIG_RKFLASH for fallback HAVE_BLOCK_DEVICE
RKFLASH also works as a block device, so add the
dependency here.

Change-Id: I22791156465302984adbbdce76ddc01242f2bb7e
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-07-18 15:52:38 +08:00
Joseph Chen 243527b501 console: support timestamp for printf
with this patch, we can see the detail boot time of boot flow.
The U-Boot log is like this:

[    0.259266] U-Boot 2017.09-01739-g856f373-dirty (Jul 10 2018 - 20:26:05 +0800)
[    0.260596] Model: Rockchip RK3399 Evaluation Board
[    0.261332] DRAM:  3.8 GiB
Relocation Offset is: f5bfd000
Using default environment

[    0.354038] dwmmc@fe320000: 1, sdhci@fe330000: 0
[    0.521125] Card did not respond to voltage select!
[    0.521188] mmc_init: -95, time 9
[    0.671451] switch to partitions #0, OK
[    0.671500] mmc0(part 0) is current device
......

Change-Id: I3ce2a4466f9ecd9eeb6b334ba4ba48391aa47c30
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-17 10:07:08 +08:00
Nickey Yang b520084e79 configs: rockchip: enable edp display for fennec-rk3288
Change-Id: I4ed48d9d4c6ead8a83a5117f27921f80e7e8dae4
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-07-17 10:05:43 +08:00
Nickey Yang c125f78268 configs: rockchip: enable edp display for evb-rk3288
Change-Id: I57bf828e287b7a1cd64fa87472ca46171c8046fd
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-07-17 10:05:43 +08:00
Joseph Chen 71aebe781c dm: regulator: add regulator_get_suspend_enable and regulator_get_suspend_value
Change-Id: Ib5148f588896ff76a465923fb12956dc6c433de7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:43:12 +08:00
Andy Yan 0958c00c07 rockchip: rk3308: enable lzo/lz4/gzip compressed kernel image
Change-Id: Ic44218ddf2ee8a993b4530cad04d712d6aecfccc
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-07-14 11:52:45 +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 94685712a7 rockchip: common: fix scan mmc 1 bug
Set detect mmc 1 and rkimgtest mmc 1 at the same
level. If not, the devtype will be set as default
when run rkimgtest mmc 1 fail but not scan other
storge devices.

Change-Id: I971ea5a8e70f17641483f00b8d467ac5757ca533
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-07-04 09:30:39 +08:00
Joseph Chen 3476b70682 include: rk_timer_irq: add rk3399 TIMER_CTRL definition
Change-Id: I2e88b19b722a7f6a9171c5f1bbfbd7592c525f8c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Elaine Zhang 6bfdfc4f06 clk: rockchip: rk3399: support dual pll for vop
set the vop's parent just vpll and cpll,
set vop parent in dts node,the same as kernel setting.
i.e:
&vopb {
	status = "okay";
	assigned-clocks = <&cru DCLK_VOP0_DIV>;
	assigned-clock-parents = <&cru PLL_VPLL>;
};
&vopl {
	status = "okay";
	assigned-clocks = <&cru DCLK_VOP1_DIV>;
	assigned-clock-parents = <&cru PLL_CPLL>;
};

Change-Id: I07ab4e2837cf7fc0860e8b4d14adb8936f5cb27a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-06-28 16:35:33 +08:00
William Wu f13b6e2815 rockchip: config: enable ohci support for rk3399
We have added OHCI nodes in rk3399 device-tree, so let's
enable OHCI config to support USB 1.1/1.0 in rk3399 boards.

Change-Id: I0a2af0e404b281c6bec627dc7871471043b8a65a
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-06-28 16:24:34 +08:00
William Wu 2878d5a3aa usb: dwc3: init phy utmi width in platform data
On rk3399 board, we need to configure phy interface UTMI+ width
to 16 bits via the property "snps,phyif-utmi-bits" of dwc3 node.
But we can't the get the property from kernel dtb. So this patch
initialize the phy interface UTMI+ width in dwc3 platform data,
and not dependent on the property in dtb.

Change-Id: I3f6b05e0d72806242a128c85f82b260f61ac4f95
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-06-28 16:24:34 +08:00
Joseph Chen adde78bf70 serial: ns16550: use fifo and flush console before jumping to OS
with this patch, U-Boot can save a lot of boot time which
depends on how much log we print.

Change-Id: Ib96e9343e9439d251c2c40be14609bc08d638931
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-22 17:17:23 +08:00
Joseph Chen 50a5d4fff3 env_default: add "silent=enable" when CONFIG_SILENT_CONSOLE enabled
framework requires users to enable slient console by both setting
CONFIG_SILENT_CONSOLE and env "silent", it's really unnecessary,
let's fix it.

Change-Id: I92c9792f74a7edf61fe0947617038709d8b14d8d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-15 16:48:11 +08:00
Joseph Chen c563adc74e rockchip: add interrupt debugger to dump pt_regs
We install a timer interrupt and dump pt_regs when
the timeout event trigger. This help us to know cpu
state when system hang.

Change-Id: I91aa2322036ae83ac8b9cd299bef9b521995d85b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-13 10:56:38 +08:00
Jason Zhu ab608f806e lib: avb: update avb source code
according to google lib avb
commit id: 44e07124afb1f46af0d745d83481f49c482900b1

Change-Id: Ie59a7265699e3e6b1673bb64da6d1c7a1e7b6201
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Jason Zhu 57c7f8fe0d lib: avb: support generate unlock challenge
Change-Id: Ia21746ec2bc729fd92ca7ea7a3320dfcbd4dd238
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Jason Zhu 83ab7b4937 lib: avb: rk: add authenticated unlock interface
Change-Id: Ib2aa1ac07d25f14aa08fc759ec99b6ba64d6abef
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Caesar Wang 2eddc6d65f rockchip/rk3399: Fixes the typo
Change-Id: I2133cae52c78edbead32ad57b47d22dfb12ab785
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2018-06-12 18:03:22 +08:00
Andy Yan d5d88d949f rockchip: rv1108: use RKIMG_BOOTCOMMAND
Boot system by bootrkp or boot_android

Change-Id: Ieea7aa778ae14a08f7c40c48a88822058a2985f5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-06-07 08:49:10 +08:00
Andy Yan c791e8a87d rockchip: rk3308: set text base to 0x00600000
Memory layout now:
-----------------
|Offset| Blob   |
-----------------
|0M    | ATF    |
-----------------
|2M    | OP-TEE |
-----------------
|6M    | U-BOOT |
-----------------

Also remove unused SPL definition.

Change-Id: I3daadd45267c90752de51aa6ec8ccdf1d5e1c2b3
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-06-07 08:49:10 +08:00
Elaine Zhang 1636e7c2d4 clk: rockchip: rv1108: Make clock ids consistent with kernel
Change-Id: Idd295c633dffbe2ed6c3f5b6e115b0fd5b040251
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-06-06 17:56:31 +08:00
Hisping Lin 981b79162b lib: optee_client: get share memory config to init
Change-Id: I92fff248650ff239e050fb058ee095e9bed231c6
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-06 09:19:41 +08:00
Finley Xiao 4af5b92cfb clk: rockchip: rk3308: Make clock ids consistent with kernel
Change-Id: I79db3bd2faa4f296efab68d15cae5548314b446f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-06-05 08:56:08 +08:00
Kever Yang 26258180d6 rockchip: rk3328: config: update for rkimg support
Change-Id: Ia1599b94f6a243bd75edb923d7956a45396193ac
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-01 17:39:46 +08:00
Lin Huang 640d29ee2a config: rk3288: support android boot image
The boot.img will instead of the kernel.img and resource.img on linux
platform, so need to support android boot image in rk3288 uboot.

Change-Id: I6d7d42d80026cad594e720e279b7213dd4adcadd
Signed-off-by: Lin Huang <hl@rock-chips.com>
2018-06-01 17:16:38 +08:00
Elaine Zhang 5cb579f13b rockchip: clk: rv1108: Add some frequency setting interfaces
support PLL freq setting,
support bus and peri clk freq setting,
support aclk vio and dclk vop freq setting.

Change-Id: I894552c1e1bb1bd13a143e200edf289234a53c1d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-06-01 11:55:11 +08:00
Andy Yan b4bed602c0 rockchip: rk3308: add AAarch32 execution state support
Support boot ARMv8 based RK3308 on AARCH32 state

Change-Id: I62f857b61668fb6ff50136ffff2b09349492c218
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-05-28 08:55:26 +08:00
Jason Zhu e424c91f23 rockchip: rk3308: enable CONFIG_SUPPORT_EMMC_RPMB
Change-Id: I8fc57eb27f45efd6d3e92c56813e7f1959c0960b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-05-28 08:54:18 +08:00
Finley Xiao 9f8e13d3a0 rockchip: board: probe clks after load kernel dtb
pmucru isn't referenced on some platforms, so pmucru driver can't
probe that the "assigned-clocks" is unused.

Change-Id: I390b302c9101f87dcd9264fda39e1f2e0e66d2b3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-05-25 11:46:18 +08:00