Commit Graph

130 Commits

Author SHA1 Message Date
Joseph Chen 7c79bd2280 common: board_r: fix mtd blk compile error
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie24f8c9c7e0b2642d021ec5ce673e17b5c815514
2020-05-27 11:42:03 +08:00
Jason Zhu 4e2ae7292a common: board_r: apply mtd_blk_map_partitions()
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I2e1fd21a6a41f8b86ab6f52c69631018a88445ec
2020-05-26 22:13:22 +08:00
Joseph Chen b3622f5b4f common: board_r: skip initr_nand() if kernel dtb is enabled
Nand will be initialized at init_kernel_dtb().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I41ec1edfcb6328cbe02435143f212453e1638c80
2020-05-13 09:05:41 +08:00
Rick Chen ade0ea07bd UPSTREAM: riscv: Modify generic codes to support RISC-V
Support common commands bdinfo and image format,
also modify common generic flow for RISC-V.

Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Signed-off-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Change-Id: Id58d17cd58433fdadc8ce7ee78d72035f84adb53
(cherry picked from commit 068feb9b86d991283c43b56e36094f4e6f484d04)
2020-04-14 12:45:33 +08:00
Joseph Chen d07cb2b8b1 common: board_r: add ENV_MEM_LAYOUT_SETTINGS1 into mininum env
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I865256861668c424806a83d9327b662e480ad737
2020-04-01 17:30:41 +08:00
Joseph Chen fc722856eb common: board_r: add minimum nowhere env for board init.
Storage env or kernel dtb load depends on bootdev, while bootdev
depends on env varname: devtype, devnum and rkimg_bootdev, etc.
So we have to use nowhere env firstly and cover the storage env
after it is loaded.

Providing a minimum and necessary nowhere env for board init to
avoid covering the other varnames in storage env.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8362c24376e7530f15335f26197a7cddbcae579c
2020-02-25 14:18:15 +08:00
Kever Yang 997d73f9dc board_r: re-order the board_early_init_r()
The board_early_init_r() suppose to be called before board_init(),
then the board callback functions in board_r will be:
- board_early_init_r()
- board_init()
- board_late_init()

Change-Id: I516fcbae91548e6e0ed469129ee5d11ee09b0a1e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-06 10:28:41 +08:00
Adam Ford 1490eb89f4 UPSTREAM: Convert CONFIG_SPI to Kconfig
This converts the following to Kconfig:
   CONFIG_SPI

This partly involves updating code that assumes that CONFIG_SPI implies
things that are specific to the MPC8xx SPI driver.  For now, just update
the CONFIG tests.  This also involves reworking the default for
CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a
reasonable default, as it does not cause any compile failures.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit f1b1f77060beadbfe9f42a3be00019bd025afbd6)
Change-Id: Ie9f15ada869105eb407f41d4df7eecbaa916b940
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Joseph Chen 8626b64732 common: board_r: add console_record_reset_enable() call
It's fine to call it by initr_console_record() since initr
malloc was setup.

Change-Id: I2de9f0bf76499e5c04d4ce57aa48800d6a6151db
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-09 18:07:45 +08:00
Joseph Chen 309d75e755 command: board_f/r: add sysmem and bidram
During board_f sequence, it's able to add any count of dram banks
and validate memory layout after reserve_xxx() done, stop bootflow
if there is something wrong.

During board_r sequence, it's able to manage all memory blocks and
add reserve memory blocks for bi_dram[] at late bootflow, it's
nesscessary for AMP boot.

Change-Id: I4443a809792bb04e205bb26d79870c85cb5fe7bd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 505b141795 common: board_r: add board_initr_caches_fixup()
Remove dram_initr_banksize(), use mmu_set_region_dcache_behaviour()
in board_initr_caches_fixup() to set region MMU table attr is more
easily.

Change-Id: I9d9917e938fe5bbab5aa27575a5c8592ff08ab50
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 322222b253 common: board_r: add sysmem init
setup right after malloc init done.

Change-Id: I6dbf55d825d0b03ed2cc64f2dab0a7331ce56228
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Joseph Chen 8c2a7835d0 common: board_r: enable initr_serial() anyway
If we don't enable initr_serial(), even after relocation done, the
serial driver always use no relocation address of ns16550_serial_ops
which is setup in serial_init(). This makes abort issue when arm64 kernel
is load to overlap the ram area.

fixes: 064eb49314
(serial: ns16550: support using pre-loader serial)

Change-Id: Iab67010ba3712754c036ecb2aee76c13a0b200b6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:28:16 +08:00
Joseph Chen 645a442d90 common: support skip U-Boot relocation
Change-Id: I8640907204c82928c2fb07177835dc55a126aaf0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-01 11:47:26 +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 6ba4112660 board_r: env: support storage env when kernel dtb is enabled
if we would like to use kernel dtb, it must depends on nowhere
env to detect boot media and initialize it. After storage is
initialized, we switch env from nowhere to CONFIG_ENV_IS_IN_xxx=y,
nowhere env info will append or override to storage env.

Change-Id: Id1cf44d4b25dcaba3c142b283ed093bed0decafe
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-18 10:36:25 +08:00
Joseph Chen 123c920622 board_r: skip mmc init when CONFIG_USING_KERNEL_DTB is enabled
When CONFIG_USING_KERNEL_DTB is enabled, mmc has been initialized earlier.

Change-Id: If3d7374cbbd4e403d9627c44133bf5fd1aeb9af8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-23 10:20:54 +08:00
Joseph Chen f4d148502c board_r: add dram_initr_banksize()
Some platform requires to reserve memory regions for some firmware
to avoid kernel touches it, but U-Boot may have communication with
firmware by share memory. So that we had better reserve firmware
region after the initr_caches() which enables MMU and init
translation table, we need firmware region to be mapped as cacheable
like other regions, otherwise there would be dcache coherence issue
between firmware and U-Boot.

Change-Id: Icb986022b484c96dffcafc98972ae24362cb8e4b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-07 10:47:42 +08:00
Joseph Chen 7f571427ef board_r: add interrupt_debugger_init()
provide for platforms to override as early as possible since
interrupt is ready.

Change-Id: I803620b71c3f1559e79074c03bee36a84f1ebc1c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-13 10:56:38 +08:00
Joseph Chen 3fc26c82e8 board_r: initialize interrupt earlier
Change-Id: I1c674efd0d1b7e8229179ac570727da9b4adab27
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-12 18:03:55 +08:00
Kever Yang fac2f0408a common: board_r: init env before board_init()
We need to get and update env if we need to read kernel dtb in board_init().
Note that the env is NOWHERE now, or else we need to init emmc first if
ENV_IS_IN_MMC.

Change-Id: I22685fea77315811f3ff2bac7fb29d3b9206be34
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-10 10:40:52 +08:00
Kever Yang d2e8ba4eb0 Revert "rockchip: add support to load and use kernel dtb"
This reverts commit af586a3812.

Change-Id: Ie1f8012b89ac810e3bc6219459127bc9ee88c674
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:12:44 +08:00
Kever Yang af586a3812 rockchip: add support to load and use kernel dtb
We are going to use a tiny dtb(with 'u-boot,dm-pre-reloc') in pre-relocate,
and then read kernel dtb and use it after relocate.
This feature only works with CONFIG_OF_LIVE enabled now.

Change-Id: I429ccd90ef562a96f2f7916255e7e427ce8f451d
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 16:40:36 +08:00
Simon Glass a239d69a77 UPSTREAM: log: Plumb logging into the init sequence
Set up logging both before and after relocation.

Change-Id: I225a1077880b14a6f3eabc19b2a5b9fe4c6a530d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit af1bc0cf46c49c5ddb13b8c75bad31a05a137eba)
2018-01-17 15:27:28 +08:00
Simon Glass 785b4fbf6c Drop the log buffer
This does not appear to be used by any boards. Before introducing a new
log system, remove this old one.

Change-Id: I798cd4aff50b7136ae9f84362185f9f73b04f710
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c5404b64fb5a35d41f7eff6d12b8ffdb0c851040)
2018-01-17 15:27:28 +08:00
Tuomas Tynkkynen b0ec94428e UPSTREAM: Drop CONFIG_HAS_DATAFLASH
Last user of this option went away in commit:

fdc7718999 ("board: usb_a9263: Update to support DT and DM")

Change-Id: Id05869deccb88c1102700dd5af58a8c249e3e9e2
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c68c03f52badc90951dbf8a054c0e500e04bf365)
2018-01-17 15:27:28 +08:00
Simon Glass 35affd7a2f env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()
Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:44 -04:00
Simon Glass bfebc8c965 env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()
We are now using an env_ prefix for environment functions. Rename these
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:32 -04:00
Simon Glass 018f530323 env: Rename common functions related to setenv()
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:23:32 -04:00
Simon Glass 382bee57f1 env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:22:18 -04:00
Andy Yan f1896c45cb spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LEN
Some platforms have very limited SRAM to run SPL code, so there may
not be the same amount space for a malloc pool before relocation in
the SPL stage as the normal U-Boot stage.

Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN,
so the size of pre-relocation malloc pool can be configured memory
space independently.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
[fixed up commit-message:]
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-07-27 14:59:03 +02:00
Simon Glass b0895384be Allow displaying the U-Boot banner on a video display
At present the U-Boot banner is only displayed on the serial console. If
this is not visible to the user, the banner does not show. Some devices
have a video display which can usefully display this information.

Add a banner which is printed after relocation only on non-serial devices
if CONFIG_DISPLAY_BOARDINFO_LATE is defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-11 10:08:19 -06:00
Andy Shevchenko daab59ac05 avr32: Retire AVR32 for good
AVR32 is gone. It's already more than two years for no support in Buildroot,
even longer there is no support in GCC (last version is heavily patched 4.2.4).

Linux kernel v4.12 got rid of it (and v4.11 didn't build successfully).

There is no good point to keep this support in U-Boot either.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-06 16:17:19 -04:00
Heiko Schocher 5b8e76c35e powerpc, 8xx: remove support for 8xx
There was for long time no activity in the 8xx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in 8xx,
so remove it (with a heavy heart, knowing that I remove
here the root of U-Boot).

Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12 08:37:55 -04:00
Simon Glass a132f77088 bootstage: Record time taken to set up the live device tree
This time is interesting as a comparision with the flat device tree time.
Add it to the record.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05 14:13:09 -04:00
Simon Glass 63c5bf48d5 bootstage: Record the time taken to set up driver model
Driver model is set up ones before relocation and once after. Record the
time taken in each case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05 14:13:07 -04:00
Simon Glass 5ac44a5543 bootstage: Init as early as possible
At present we don't allow use of bootstage before driver model is running.
This means we cannot time the init of driver model itself.

Now that bootstage requires its own board-specific timer, we can move its
init to earlier in the sequence, both before and after relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05 14:13:07 -04:00
Simon Glass 12d738ae4c api: Add a header for api_init()
Put this in its own header instead of using common.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05 11:02:29 -04:00
Simon Glass 3af86a4e23 dm: Build a live tree after relocation
If enabled, build a live device tree after relocation. This can then be
used by driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:06 -06:00
Simon Glass fc843a02ac Kconfig: Add a CONFIG_IDE option
At present IDE support is controlled by CONFIG_CMD_IDE. Add a separate
CONFIG_IDE option so that IDE support can be enabled without requiring
the 'ide' command.

Update existing users and move the ide driver into drivers/block since
it should not be in common/.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-22 12:45:27 -04:00
Tom Rini 4125bbcef6 Merge branch 'master' of git://git.denx.de/u-boot-mmc
- Add #undef CONFIG_DM_MMC_OPS to omap3_logic in the SPL build case, to
  match other TI platforms in the same situation.

Signed-off-by: Tom Rini <trini@konsulko.com>
2017-05-16 08:10:50 -04:00
Masahiro Yamada 4aa2ba3a34 mmc: replace CONFIG_GENERIC_MMC with CONFIG_MMC
Now CONFIG_GENERIC_MMC and CONFIG_MMC match for all defconfig.
We do not need two options for the same feature.  Deprecate the
former.

This commit was generated with the sed script 's/GENERIC_MMC/MMC/'
and manual fixup of drivers/mmc/Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-05-15 18:28:23 +09:00
Simon Glass 213f27f3f9 Drop CONFIG_I2CFAST
This option is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-15 06:19:00 +02:00
Simon Glass 96d4b75c0d board_f: Make init_helpers generic
This header file is used by two archs. It could be used by all of them
since it allows the cache to be on during relocation. Move it into a
generic file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-04-05 16:36:56 -04:00
Tom Rini 936478e797 SPARC: Remove
The SPARC architecture is currently unmaintained, remove.

Cc: Francois Retief <fgretief@spaceteq.co.za>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-05 13:52:20 -04:00
Hou Zhiqiang 203db38a94 mtd: nand: remove nand size print from nand_init function
Add nand_size() function to move the nand size print into initr_nand().
Remove nand size print from nand_init() to allow other function to call
nand_init() without printing nand size.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-03-28 10:39:33 -07:00
Masahiro Yamada e856bdcfb4 flash: complete CONFIG_SYS_NO_FLASH move with renaming
We repeated partial moves for CONFIG_SYS_NO_FLASH, but this is
not completed. Finish this work by the tool.

During this move, let's rename it to CONFIG_MTD_NOR_FLASH.
Actually, we have more instances of "#ifndef CONFIG_SYS_NO_FLASH"
than those of "#ifdef CONFIG_SYS_NO_FLASH".  Flipping the logic will
make the code more readable.  Besides, negative meaning symbols do
not fit in obj-$(CONFIG_...) style Makefiles.

This commit was created as follows:

[1] Edit "default n" to "default y" in the config entry in
    common/Kconfig.

[2] Run "tools/moveconfig.py -y -r HEAD SYS_NO_FLASH"

[3] Rename the instances in defconfigs by the following:
  find . -path './configs/*_defconfig' | xargs sed -i \
  -e '/CONFIG_SYS_NO_FLASH=y/d' \
  -e 's/# CONFIG_SYS_NO_FLASH is not set/CONFIG_MTD_NOR_FLASH=y/'

[4] Change the conditionals by the following:
  find . -name '*.[ch]' | xargs sed -i \
  -e 's/ifndef CONFIG_SYS_NO_FLASH/ifdef CONFIG_MTD_NOR_FLASH/' \
  -e 's/ifdef CONFIG_SYS_NO_FLASH/ifndef CONFIG_MTD_NOR_FLASH/' \
  -e 's/!defined(CONFIG_SYS_NO_FLASH)/defined(CONFIG_MTD_NOR_FLASH)/' \
  -e 's/defined(CONFIG_SYS_NO_FLASH)/!defined(CONFIG_MTD_NOR_FLASH)/'

[5] Modify the following manually
  - Rename the rest of instances
  - Remove the description from README
  - Create the new Kconfig entry in drivers/mtd/Kconfig
  - Remove the old Kconfig entry from common/Kconfig
  - Remove the garbage comments from include/configs/*.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-02-12 14:30:25 -05:00
Simon Glass fb92308b98 x86: board_r: Set the global data pointer after relocation
Since 'gd' is just a normal variable on 64-bit x86, it is relocated by the
time we get to board_init_r(). The old 'gd' variable is passed in as
parameter to board_init_r(), presumably for this situation.

Assign it on 64-bit x86 so that gd points to the correct data.

Options to improve this:
- Make gd a fixed register and remove the board_init_r() parameter
- Make all archs use this board_init_r() parameter

The second has a TODO in the code. The first has a TODO in a future commit
('x86: Support global_data on x86_64')

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06 11:38:46 +08:00
Simon Glass 4acff45247 board_f/r: Use static const for the init sequences
These tables should be declared static const. Unfortunately the table in
board_r is updated on machines with manual relocation.

Update them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06 11:38:46 +08:00
Simon Glass a8523a808f Drop CONFIG_CMD_DOC
This is not used in U-Boot, and the only usage calls a non-existent
function. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25 17:38:45 -05:00