Commit Graph

39 Commits

Author SHA1 Message Date
Joseph Chen 61184b8f14 rockchip: board: remove verbose "Using kernel dtb"
This is a debug message to know if we use kernel dtb.
We have already got this info from "DTB: rk-kernel.dtb",
so remove it.

Change-Id: I28e29e43aa818ac61c9864b94bd80ceb85fc9c3a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-29 20:40:08 +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 2dc2d048e2 rockchip: lmb: limit highest memory from 768MB to 512MB for 32-bit platform
Ramdisk is a compressed image and it expands after descompress, which accesses
768MB+ memory and brings "Unable to handle kernel paging request at virtual address ...".

We make a appointment that the highest memory is 512MB, it makes lmb alloc safer.

fixes: 2c6a058b7e
(rockchip: implement board_lmb_reserve())

Change-Id: I728a1fbff216194b940372713387cf171028b20b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-16 08:41:36 +08:00
Joseph Chen 8f88277439 rockchip: support get boot devtype and devnum from atags
- preloader would pass bootdev info;
- avoid going through all the possible bootdev;
- rename devtype_num_envset() to boot_devtype_init();

Change-Id: Ia047c744dc7aca97db97664fc92473e46ba102a9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-16 08:41:36 +08:00
Joseph Chen 2c6a058b7e rockchip: implement board_lmb_reserve()
Using last bi_dram[...] to initialize "bootm_low" and "bootm_mapsize".
This makes lmb_alloc_base() always alloc from tail of sdram.
If we don't assign it, bi_dram[0] is used by default and it may cause
lmb_alloc_base() fail when bi_dram[0] range is small.

Change-Id: I13c2c2d6135e26e647dcfde4c173d896c800fea5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-13 14:07:56 +08:00
Joseph Chen 064eb49314 serial: ns16550: support using pre-loader serial
- pass pre-loader serial configure by rk atags;
- it depends on serial aliases to find uart port;
- enabled by CONFIG_ROCKCHIP_USING_PRELOADER_SERIAL;

Change-Id: I6723cccc5e1f3dac77203b4cc19cdac631f5133b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-19 17:40:56 +08:00
Joseph Chen 98ff9f07f8 rockchip: add IF_TYPE_RAMDISK support
Change-Id: I505606516bf186d8e869702c77f563d5cf0d6f37
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-17 09:32:28 +08:00
Joseph Chen 567735c8d9 rockchip: enable icache/dcache anyway
actually, icache is only enabled when not define CONFIG_SKIP_LOWLEVEL_INIT,
icache/dcache had better not depend on other configures macros, so enable
them anyway.

Change-Id: Iba843ffd481a24c3b0235323253a5b423160c867
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-28 11:24:24 +08:00
Joseph Chen e0b8740820 rockchip: board: rk3368 usb suppots find node by compatible
Change-Id: I02873c9a111023b79711fc895a87973c58690687
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-17 09:57:39 +08:00
Joseph Chen bb2992fad0 rockchip: board: lower the charge animation failed info
Change-Id: Ibb09da0fbf5e13fcaadf0a54ce7932958600fd2f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-15 09:23:28 +08:00
YouMin Chen ebb6c43980 rockchip: board: compulsory execution board_debug_uart_init
Insure if defined CONFIG_SUPPORT_SPL but not use SPL bin,
board_debug_uart_init still have be called.

Change-Id: I2e8a7bf1cfb4e6ec4a916983eb13652afe8c8af2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-07-25 11:07:43 +08:00
Kever Yang d94724f747 rockchip: board: do not probe mmc/nand in init_kernel_dtb()
The rkimg_bootdev cmd will do it instead.

Change-Id: Ic4bef6e5d14837e80c185fc2cd1123f34b015054
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-07-12 20:56:05 +08:00
William Wu e7b5bb3cc9 rockchip: usb: dwc2: support rk3288 usb with kernel dtb
Whit kernel dtb support, we need to get rk3288 dwc2 otg
node by compatible "rockchip,rk3288_usb20_otg" rather than
"snps,dwc2", because rk3288 dwc2 otg uses rockchip legacy
dwc2 driver "dwc_otg_310".

Change-Id: Ib7b536e554776f1dd09d34d0a2ac1754df9c753e
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-07-09 19:41:10 +08:00
Joseph Chen eeb3338caa rockchip: board: print debug when not find charge display driver
Change-Id: Ie75068bed96ef146e4dd949bd698ae64317a16b0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Joseph Chen a38e17c3f4 rockchip: board: add message when using kernel dtb
Change-Id: Iace236ec6244a0239868de2fa063b0747eec76c3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Finley Xiao 058e5d9497 rockchip: px30: implement set_armclk_rate()
Add support to set armclk rate.

Change-Id: Ie96d8680e9b3666f8131aeb553594a271d426566
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-06-24 17:19:34 +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
Joseph Chen e09b1e4a58 bootm-fdt: fixup rk3288w compatible in fdt
1. recoganize RK3288w according to HDMI Revision ID;
2. proive a weak board_fdt_fixup() as common fixup place;
3. move rockchip_display_fixup() into board_fdt_fixup();

Change-Id: Ib3f4e991ffd7420a8f39390ae067340a65183a26
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-06 17:55:12 +08:00
Finley Xiao efdbac3478 clk: rockchip: rk3308: implement soc_clk_dump
Change-Id: I6f0c3f56a878f491c4bb1deafd8e020e052e2287
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-06-05 08:56:08 +08:00
Kever Yang 99fa2bd0a6 rockchip: board: remove fastboot key detect
Most of rockchip board do not have a fastboot key, remove it
from common board init.
Boards need to add it back in per-board init if needed.

Change-Id: I8e3ae1f767485ae075811f406c6822f333d1bd78
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-04 12:24:52 +08:00
Jason Zhu 064b2675e0 rockchip: board: support get serialno
The serialno is used to identify the device.
Serialno can be got from vendor storage, efuse,
and generated ramdom. The order is:
vendor storage > cpuid(efuse) > ramdom

Change-Id: Ic805848d59eec761fe1eac6ee43558b2ba06e3c8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-04 09:56:38 +08:00
Frank Wang 6f7b6465e9 rockchip: board: fix usb-otg address parse error
Using fdt_translate_address() instead of fdtdec_get_addr() to avoid
address parse error when 64-bits CPU works at 32-bits mode but uses
64-bits DT files.

Change-Id: I8c605ab2e5b3fc0d5267af6094c2a7f54c2d7e89
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2018-05-28 17:17:45 +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
Joseph Chen 740107bb19 rockchip: support alternative kernel dtb depends on adc/gpio
1. support adc value recognize;
2. support gpio value recognize;

Change-Id: I8bcbdd914405184d46029c4995c09b09e36c7ea3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-05-11 11:12:35 +08:00
Kever Yang 419dcb5b07 rockchip: move display dtb fixup to bootm
Change-Id: I25102790fa6330c7b3ce3f9904e250944083c5ca
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-03-02 10:05:39 +08:00
Kever Yang 530f7262ca rockchip: board: update logo reserve memory in late init
Change-Id: I455b78b9abe0bc4d28dba1a0cd9971262c313365
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-23 10:28:27 +08:00
Kever Yang 575777c587 rockchip: board: init uart iomux in board_init if no SPL support
Rockchip may use miniloader instead of SPL, in this case, the iomux
for uart intput is setting, we need to init it in boart_init().

Change-Id: I1ad4fc8cef1aeb222c284dfaf5c2d34a3f1625dd
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-10 17:47:08 +08:00
Kever Yang f8aaa2c25f rockchip: board: add kernel dtb support
Load dtb from mmc/nand, rebuild live dt and scan dev.

Change-Id: If079b23702d0df333b62a14fcf3f6c2c37d3d670
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:14:03 +08:00
Kever Yang 3877199611 rockchip: add common board file for rockchip platform
We use common board/spl/tpl file for all rockchip SoCs,
- all the SoC spec setting should move into SoC file like rk3288.c;
- tpl is option and only purpose to init DRAM, clock, uart(option);
- spl do secure relate one time init, boot device select, boot into
  U-Boot or trust or OS in falcon mode;
- board do boot mode detect, enable regulator, usb init and so on.

Change-Id: I7b5fa1e3e6e5f4a30a382003215425530087a586
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-23 08:45:27 +08:00
Jacob Chen cd77fd1b43 rockchip: rename board.c to rk3288-board.c
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-10-01 18:36:55 -06:00
Xu Ziyuan 5a4a90f6e6 rockchip: rk3288: skip lowlevel_init process
lowlevel_init() is never needed for rk3288, so drop it.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-09-22 07:57:02 -06:00
Simon Glass c3aad6f65b rockchip: Use rockchip_get_clk() to obtain the SoC clock
The current code picks the first available clock. In U-Boot proper this is
the oscillator device, not the SoC clock device. As a result the HDMI display
does not work.

Fix this by calling rockchip_get_clk() instead.

Fixes: 135aa950 (clk: convert API to match reset/mailbox style)
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
2016-07-25 20:46:45 -06:00
Xu Ziyuan 266c8fad51 rockchip: rk3288: add fastboot support
Enable fastboot feature on rk3288.

This path doesn't support the fastboot flash function command entirely.
We will hit "cannot find partition" assertion without specified
partition environment. Define gpt partition layout in specified board
such as firefly-rk3288, then enjoy it!

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-07-25 20:44:19 -06:00
Xu Ziyuan b47ea79219 rockchip: add option to change method of loading u-boot
If we would like to boot from SD card, we have to implement mmc driver
in SPL stage, and get a slightly large SPL binary. Rockchip SoC's
bootrom code has the ability to load spl and u-boot, then boot.

If CONFIG_ROCKCHIP_SPL_BACK_TO_BROM is enabled, the spl will return to
bootrom in board_init_f(), then bootrom loads u-boot binary.

Loading sequence after rework:
bootrom ==> spl ==> bootrom ==> u-boot

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed up spelling of U-Boot, boorom, opinion->option, Rochchip:
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-25 20:44:18 -06:00
Stephen Warren 135aa95002 clk: convert API to match reset/mailbox style
The following changes are made to the clock API:
* The concept of "clocks" and "peripheral clocks" are unified; each clock
  provider now implements a single set of clocks. This provides a simpler
  conceptual interface to clients, and better aligns with device tree
  clock bindings.
* Clocks are now identified with a single "struct clk", rather than
  requiring clients to store the clock provider device and clock identity
  values separately. For simple clock consumers, this isolates clients
  from internal details of the clock API.
* clk.h is split so it only contains the client/consumer API, whereas
  clk-uclass.h contains the provider API. This aligns with the recently
  added reset and mailbox APIs.
* clk_ops .of_xlate(), .request(), and .free() are added so providers
  can customize these operations if needed. This also aligns with the
  recently added reset and mailbox APIs.
* clk_disable() is added.
* All users of the current clock APIs are updated.
* Sandbox clock tests are updated to exercise clock lookup via DT, and
  clock enable/disable.
* rkclk_get_clk() is removed and replaced with standard APIs.

Buildman shows no clock-related errors for any board for which buildman
can download a toolchain.

test/py passes for sandbox (which invokes the dm clk test amongst
others).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-06-19 17:05:55 -06:00
Simon Glass 74e53e0e9b rockchip: Add a simple 'clock' command
Add a command that displays the PLLs and their current rate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-21 20:42:36 -07:00
Simon Glass ad443b7290 rockchip: Don't skip low-level init
At present the low-level init is skipped on rockchip. Among other things
this means that the instruction cache is left disabled. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-21 20:42:36 -07:00
huang lin be1d5e0388 rockchip: rk3036: Add core Soc start-up code
rk3036 only 4K size SRAM for SPL, so only support
timer, uart, sdram driver in SPL stage, when finish
initial sdram, back to bootrom.And in rk3036 sdmmc and
debug uart use same iomux, so if you want to boot from
sdmmc, you must disable debug uart.

Signed-off-by: Lin Huang <hl@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed build error for chromebook_jerry, firefly-rk3288:
Signed-off-by: Simon Glass <sjg@chromium.org>

Series-changes: 8
- Fix build error for chromebook_jerry, firefly-rk3288
2015-12-01 08:07:22 -07:00
Simon Glass 2444dae587 rockchip: Add core SoC start-up code
Add code for starting up U-Boot SPL and U-Boot proper. This is generic and
makes use of devices provided by the board- or SoC-specific code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-09-02 21:28:24 -06:00