Commit Graph

16396 Commits

Author SHA1 Message Date
Andreas Dannenberg
a5a5d997b4 spl: Allow performing BSS init early before board_init_f()
On some platform we have sufficient memory available early on to allow
setting up and using a basic BSS prior to entering board_init_f(). Doing
so can for example be used to carry state over to board_init_r() without
having to resort to extending U-Boot's global data structure.

To support such scenarios add a Kconfig option called CONFIG_SPL_EARLY_BSS
to allow moving the initialization of BSS prior to entering board_init_f(),
if enabled. Note that using this option usually should go along with using
CONFIG_SPL_SEPARATE_BSS and configuring BSS to be located in memory
actually available prior to board_init_f().

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
2019-07-17 11:12:54 -04:00
Faiz Abbas
bbcfaad59f arm: dts: k3: Add phy specific properties to SD card node
With changes in the driver requiring phy related properties,
add the same for the SD card node to prevent breaking boot with
the driver update.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17 11:12:08 -04:00
Faiz Abbas
3a1a0dfc39 arm64: dts: k3: Sync sdhci0 node from kernel and change driver name
Sync the sdhci0 node from kernel. This changes the compatible that is
required to be there in the driver. Change the same for the SD card node
which is not yet supported in kernel. This also syncs the main_pmx0 node
as a side effect.

Also change the name of the driver to match the compatible in kernel.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17 11:12:08 -04:00
Tom Rini
0e80dda32c Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
- Beelink-x2 STB support (Marcus)
- H6 DDR3, LPDDR3 changes (Andre, Jernej)
- H6 pin controller, USB PHY (Andre)
2019-07-16 11:19:31 -04:00
Andre Przywara
f96238e253 sunxi: H6: Enable USB for existing boards
So far USB was not enabled for the Allwinner H6 boards, as the PHY
driver was not ready and the clock gates were missing. Since this is now
fixed, let's add the PHY and the OHCI/EHCI drivers to the build, for
all existing H6 boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> # Pine-H64
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:13:15 +05:30
Andre Przywara
10cfbaabc1 sunxi: move SUNXI_GPIO to Kconfig
Probably for no particular reason SUNXI_GPIO was still defined the "old
way", in header files only.

Introduce SUNXI_GPIO to the Kconfig file in drivers/gpio to remove
another line from our dreadful config_whitelist.txt.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> # Pine-H64
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:13:15 +05:30
Jernej Skrabec
0824384bfb sunxi: H6: Add DDR3 DRAM delay values
Add some basic line delay values to be used with DDR3 DRAM chips on
some H6 TV boxes.
Taken from a register dump after boot0 initialised the DRAM.
Put them as the default delay values for DDR3 DRAM until we know better.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:13:14 +05:30
Andre Przywara
7656d3982a sunxi: H6: Add DDR3-1333 timings
Add a routine to program the timing parameters for DDR3-1333 DRAM chips
connected to the H6 DRAM controller.

The values were gathered from doing back-calculations from a register
dump, trying to match them up with the official JEDEC DDDR3 spec.
If in doubt, the register dump values were taken for now, but the JEDEC
recommendation were added as a comment.

Many thanks to Jernej for contributing fixes!

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:13:04 +05:30
Andre Przywara
75a8a641f3 sunxi: H6: Add DDR3 support to DRAM controller driver
At the moment the H6 DRAM driver only supports LPDDR3 DRAM.

Extend the driver to cover DDR3 DRAM as well.

The changes are partly motivated by looking at the ZynqMP register
documentation, partly by looking at register dumps after boot0/libdram
has initialised the controller.

Many thanks to Jernej for contributing some fixes!

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:09:41 +05:30
Andre Przywara
770b85a418 sunxi: H6: move LPDDR3 timing definition into separate file
Currently the H6 DRAM driver only supports one kind of LPDDR3 DRAM.
Split the timing parameters for this LPDDR3 configuration  into a
separate file, to allow selecting an alternative later at compile time
(as the sunxi-dw driver does).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:09:31 +05:30
Andre Przywara
65f80f5804 sunxi: H6: DRAM: follow recommended PHY init algorithm
The DRAM controller manual suggests to first program the PHY
initialisation parameters to the PHY_PIR register, and then set bit 0 to
trigger the initialisation. This is also used in boot0.

Follow this recommendation by setting bit 0 in a separate step.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:09:19 +05:30
Andre Przywara
1a1d1df384 sunxi: H6: DRAM: avoid memcpy() on MMIO registers
Using memcpy() is, however tempting, not a good idea: It depends on the
specific implementation of memcpy, also lacks barriers. In this
particular case the first registers were written using 64-bit writes,
and the last register using four separate single-byte writes.

Replace the memcpy with a proper loop using the writel() accessor.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-16 17:09:06 +05:30
Grygorii Strashko
6f2929d8b7 arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
Add mcu cpsw nuss pinmux and phy defs required by cpsw.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-15 13:32:26 -05:00
Grygorii Strashko
5195c10fbb arm64: dts: ti: k3-am65: add mcu cpsw node
Add mcu cpsw and its components along with scm_conf node
to have ethernet functional.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-15 13:32:25 -05:00
Alex Marginean
ec9594a50f test: dm: add MDIO test
A very simple test for DM_MDIO, mimicks a register write/read through the
sandbox bus to a dummy PHY.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-15 13:32:25 -05:00
Marcus Cooper
a9e19b8ff7 sun8i: h3: Add support for the Beelink-x2 STB
The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
dual colour LED and an optical S/PDIF connector.

Linux commit details about the sun8i-h3-beelink-x2.dts sync:
"ARM: dts: sun8i: h3: Add ethernet0 alias to Beelink X2"
(sha1: cc4bddade114b696ab27c1a77cfc7040151306da)

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-15 12:25:32 +05:30
Tom Rini
a9a3a37f92 - syscon: add support for power off
- stm32mp1: add op-tee config
 - stm32mp1: add specific commands: stboard and stm32key
 - add stm32 mailbox driver
 - solve many stm32 warnings when building with W=1
 - update stm32 gpio driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJdKK2iAAoJEOKyvdngqpN1TvcH/jj1ujNdRKn994R3DqULzFtc
 Y0WGjAciTUuV0d9gZLxPZJwlWfqxLgbmUEBlPJQJe79gaM7kNN0PgAe6GNedFhGk
 UhRR7GgbA7wogorpRo8aLe3XYEqHtgPFkf1nSiNz/AHLBg8SB20VhWcY90Kha9lh
 IJ0GK+lSdCxiyaLBC2nswnI2PS/fl4NfC7KWvujtKZduIDIOHqh5q+39llpejyuw
 WOzL/bEa4ald6JKpxOii2KXNwD1gUDQGmPzADYcIdwzJtx9hft7DBSLC5Nr+ndBz
 72TjpbtfJ/qIurv8HeXYs9mtwnCO3WP+015fog0T0zjZ48BrT1A8C96ezwLOfz0=
 =W3ny
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-stm32-20190712' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- syscon: add support for power off
- stm32mp1: add op-tee config
- stm32mp1: add specific commands: stboard and stm32key
- add stm32 mailbox driver
- solve many stm32 warnings when building with W=1
- update stm32 gpio driver
2019-07-14 09:09:49 -04:00
Adam Ford
550eebcfb4 ARM: dts: logicpd som-lvs and torpedos: Shrink SPL DTB
Since we have limited resources in SPL, it is the best interest
to keep the SPL as small as possible and that includes the DTB.
There are a few items in the device tree that can be removed,
because these boards don't use them.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-07-13 11:11:31 -04:00
Adam Ford
42f1539727 ARM: dts: logicpd-som-lv: Resync with Kernel 5.1.9
The MMC card-detect pin was incorrectly defined which was fixed.
This patch resync's the dts and removes the u-boot specific fix.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-07-13 11:11:30 -04:00
Adam Ford
4972a2a83f ARM: dts: da850: Resync with Linux 5.1.9
The da850.dtsi file had some changes.  This patch pulls in the
changes from Kernel 5.1.9

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-07-13 11:11:30 -04:00
Tom Rini
2a51e16bd5 configs: Make USE_TINY_PRINTF depend on SPL||TPL and be default
The USE_TINY_PRINTF symbol only changes things within SPL and TPL
builds, so make it depend on that support.  Next, make it default as
within these cases we should rarely have need of more advanced print
formats outside of the debug context.

To do this, in a few cases we need to correct our Kconfig dependencies
as we had cases of non-SPL targets select'ing this symbol.  Finally, in
the case of a few boards we really do need the full printf
functionality.

Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-13 11:11:29 -04:00
Niel Fourie
6e171b661e ARM: am335x: Add phyCORE AM335x R2 support
Support for Phytech phyCORE AM335x R2 SOM (PCL060) on the Phytec
phyBOARD-Wega AM335x.

CPU  : AM335X-GP rev 2.1
Model: Phytec AM335x phyBOARD-WEGA
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
eth0: ethernet@4a100000

Working:
 - Eth0
 - i2C
 - MMC/SD
 - NAND
 - UART
 - USB (host)

Device trees were taken from Linux mainline:
commit 37624b58542f ("Linux 5.1-rc7")

Signed-off-by: Niel Fourie <lusus@denx.de>
Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Marek Vasut <marex@denx.de>
2019-07-13 11:11:28 -04:00
David Lechner
1d259e4d68 ARM: legoev3: convert to driver model
This converts LEGO MINDSTORMS EV3 to the driver model. MMC, SERIAL, SPI
and SPI_FLASH are converted.

The device tree contains only the minimal nodes required by U-Boot
since the size of U-Boot is limited to 256K on this device.

Signed-off-by: David Lechner <david@lechnology.com>
2019-07-13 11:11:28 -04:00
Derald D. Woods
5579e73c8c ARM: dts: omap3-evm: Sync dts(i) files from Linux 5.1.5
Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
2019-07-13 11:11:27 -04:00
Patrice Chotard
6084e96b99 ARM: dts: stm32: Remove useless "st, stm32-gpio" compatible string
Since pinctrl_stm32 driver update, each gpio bank is now binded
by pinctrl driver. The compatible string "st,stm32-gpio" becomes
useless, remove it.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:50:58 +02:00
Patrick Delaunay
745b676d00 stm32mp1: bsec: Fix warnings when compiling with W=1
This patch solves the following warnings:

arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_read':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (offset >= STM32_BSEC_OTP_OFFSET) {
             ^~
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_write':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (offset >= STM32_BSEC_OTP_OFFSET) {
             ^~
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:50:54 +02:00
Patrick Delaunay
e609e131c1 stm32mp1: Fix warnings when compiling with W=1
This patch solves the following warnings:

arch/arm/mach-stm32mp/cpu.c:378:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
   if (instance > ARRAY_SIZE(serial_addr))
                ^

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:50:54 +02:00
Patrick Delaunay
e81f8d16e2 stm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS
Update kernel MTD partition in device tree with U-Boot information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:50:53 +02:00
Patrick Delaunay
152c84bce9 stm32mp1: add configuration op-tee
Add support of Trusted boot chain with OP-TEE
- reserved 32MB at the end of the DDR for OP-TEE

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:50:52 +02:00
Patrick Delaunay
35a54d41d9 ARM: dts: stm32mp1: sync device tree with v5.2-rc4
Synchronize device tree with v5.2-rc4 label and
update the associated u-boot dtsi.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
f4cb5d69c2 stm32mp1: key: add stm32key command
Add dedicated command to register in fuse a public hash
key provided by keygen tool.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
c60f3b3589 stm32mp1: update device tree with ETZPC status
U-Boot should disable nodes in device tree if needed according
ETZPC status in ft_system_setup().

ETZPC itself use an array on addresses to do the match between the status
bits and the node.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
05d3693688 stm32mp1: update package information in device tree
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
24cb4587f4 stm32mp1: export get_cpu_package function
Prepare update of package information update
in Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
dfda7d4c83 stm32mp1: syscon: remove stgen
Reduce difference with kernel Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Patrick Delaunay
72d18583a1 stm32mp1: syscon: remove etzpc support
Support for ETZPC is removed as this device is not present
in Linux kernel device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-12 11:18:53 +02:00
Fabien Dessenne
1958dae4f3 ARM: dts: stm32: Add ipcc mailbox support on stm32mp1
Add IPCC mailbox support on stm32mp157 eval and disco boards.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2019-07-12 11:18:53 +02:00
Tom Rini
a9758ece08 - Sandbox improvements including .dts refactor
- Minor tracing and PCI improvements
 - Various other minor fixes
 - Conversion of patman, dtoc and binman to support Python 3
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAl0nbDoRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreZcBQgAn+ojgq/hD89bihuhz2oEe6rhzHB9OkcC
 sHrVL8Jbmby/BuzISGe4oeeM5yVygBVtUiN/72JiiAHLmykqc4CpRjNvgOOAgKCy
 Ml8UyiBNNVNfrD6f9PxAKvPZf6S0gfLnomGOQ/psdEojpY5AvQxQ36D+QFZ0AMP5
 67/xjSfN9bNPw8UbgE/VhJ+WFbU948BP2EBt6+NBAtv7HW4AX9vT0famJfWEjwq8
 ftmcFOSNGgYcDQ5BwQWX1sFhnwb9XSfurlQsVYBsFA4cx4gj0DfUm1Ugr4wDD+lo
 91P+76hSBQ+mHp1HJ90WMd2vAaElG7/SoaicXo9pW6Rc7WIgTjk7gg==
 =SdZy
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-9jul19-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

- Sandbox improvements including .dts refactor
- Minor tracing and PCI improvements
- Various other minor fixes
- Conversion of patman, dtoc and binman to support Python 3
2019-07-11 18:10:11 -04:00
Tom Rini
68deea2308 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- SPL SATA enhancements to allow booting from RAW SATA device
  needed for Clearfog (Baruch)
- Enable SATA booting on Clearfog (Baruch)
- Misc changes to Turris Omnia (Marek)
- Enable CMD_BOOTZ and increase SYS_BOOTM_LEN on crs305-1g-4s
  (Luka)
- Enable FIT support for db-xc3-24g4xg (Chris)
- Enable DM_SPI on Keymile Kirkwood board with necessary changes
  for this (Pascal)
- Set 38x and 39x AVS on lower frequency (Baruch)
2019-07-11 18:09:38 -04:00
Tom Rini
79b8d3c285 UniPhier SoC updates for v2019.10
- import DT updates from Linux
 
 - add UniPhier SPI controller driver
 
 - make U-Boot image for 64bit SoCs position independent
 
 - tidy up various init code for next generation SoCs
 
 - misc cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQJSBAABCgA8FiEEbmPs18K1szRHjPqEPYsBB53g2wYFAl0nREIeHHlhbWFkYS5t
 YXNhaGlyb0Bzb2Npb25leHQuY29tAAoJED2LAQed4NsG2GMP/2n8xlbLvYKVI5nF
 NP7yn6ZI04pEliuthMZEHxUwOXx7O8luk1NGIOOoTjMJUEO+QGsh9GXwNnhfzL2P
 mtI3Vq5ZZvwpHJPYK9JKze3Dn0apEoUWaqyj2J6s/r3FUmm/k7Y5J3QHLP4fpNG+
 m5cMwxrIPT8oefM/lnF45YDA0VY84SWfHfI39o1qKL+av0VIsN/uzYBwm4uOEyh+
 ZWY4CfL362w6EW03mrTA0RoJUyFmI6Jpcj/dAyU8E4+Fxlu3ZeN9rkUdd6FgVujU
 +JFA/rl/M1iMOAjrkrsknJgTgAEBOXW8zfnflsQS/LXWigC6NgxEXtHg3loAqZQH
 rK+bhWWSbHMkSp4ek0l7owKVhWhiv4TjmStjpVO85Hw0L5hd+La3yv9jRJjjz7Ac
 J3/ROJb/QXItjJr/GU5N6UpBeyWkQXEmueNEKRm3VyQSOjyedFINQ+2hnafCFgcO
 /bJBZUZoNKgj5fK2zUfM/FOsuMGHDb06u3cJfEnS1s5YnDEl2Hr8r/WhUUnYyQZg
 fZP+J/gyZCogrNy/2ijEyPj75b9MQOV9RnatvbirastJNia9hAXI/d3FUCRzVwlp
 5glb84AuiqmFbtCjQZ0kSI8dZI4hwY262ksAPR+yEawNQTU9Ay5uEcYxUq+oj11U
 OWZf9BiDvhCNmHAlX70vWF+M/oYE
 =X9wS
 -----END PGP SIGNATURE-----

Merge tag 'uniphier-v2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier

UniPhier SoC updates for v2019.10

- import DT updates from Linux

- add UniPhier SPI controller driver

- make U-Boot image for 64bit SoCs position independent

- tidy up various init code for next generation SoCs

- misc cleanups
2019-07-11 18:08:44 -04:00
Marek Vasut
b2a2bf41ac arm: mach-omap2: am33xx: Init pinmux before clock
The board_early_init_f() inits clock before initing pinmux. However,
the clock configuration code might need to adjust PMIC settings of a
PMIC on I2C bus (e.g. board/ti/am335x/board.c does that). If the I2C
bus pin muxing is not configured before attempting to communicate
with the PMIC, the communication will silently fail and the prcm_init()
may configure fast enough CPU clock that the default voltage provided
by the PMIC would be insufficient and the platform would become
unstable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Tom Rini <trini@konsulko.com>
2019-07-11 14:11:20 -04:00
Tom Rini
c76c93a3d5 configs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMAT
The name CONFIG_LEGACY_IMAGE_FORMAT reads slightly better along with
allowing us to avoid a rather nasty Kbuild/Kconfig issue down the line
with CONFIG_IS_ENABLED(IMAGE_FORMAT_LEGACY).  In a few places outside of
cmd/ switch to using CONFIG_IS_ENABLED() to test what is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-11 14:11:18 -04:00
Miquel Raynal
2e8a720246 arm: spear: Return to BootROM if failing to boot from the main device
Overload the weak function board_boot_order() so that besides choosing
the main boot device, we can fallback on USB boot by returning in the
BootROM, eg. if the NOR flash is empty while it was the primary boot
medium.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
6d09581f78 arm: spear: Do not link the _main branch
The _main call is not supposed to return at all: don't link the
branch.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
f78fdee9fc arm: spear: Support returning to BootROM
Implement the weak board_return_to_bootrom() function so that when
enabling the spl_bootrom.c driver, one can make use of usbboot on
spear platforms. All necessary information to return to the BootROM
are stored in the BootROM's stack. The SPL stack pointer is reset so
we save the BootROM's stack pointer into the SPL .data section.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
6a9d0e275f arm: spear: Simplify start.S organization
There is no reason to do the few spear-related initialization, in a
different procedure than 'reset'. Spare one branching and get a linear
code flow by removing this indirection.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
08ad72ae81 arm: spear: Reference the link register with LR instead of R14
The link register is stored in R14. ARM assembly code allows to use
the 'lr' name to reference it instead of 'r14' which is not very
meaningful. Do the substitution to ease the reading.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
f30765b748 arm: spear: Use PUSH/POP mnemonics when relevant
Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":

        PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
        the base register sp (r13), and the adjusted address written
        back to the base register.
	PUSH and POP are the preferred mnemonic in these cases.

Let's follow this recommandation to ease the reading and substitute
LDMIA/STMDB operations with PUSH/POP mnemonics.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
76bdaaa196 arm: spear: Purely cosmetic changes in start.S
Before cleaning a bit further the spear/start.S file, apply a few
cosmetic changes: capital letters, comment indentation and small
rewriting.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
10a5b3cd99 arm: spear: Fix the main comment in start.S
This comment describes the board state at the moment where we enter
the SPL. The description is entirely wrong; re-write it to fit the
reality.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
58cbb671ef arm: spear: Drop false comment
SPL BSS lies in SRAM and is actually initialized to 0 by the SPL in
arch/arm/lib/crt0.S:_main(), which is called by cpu_init_crit.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
68cadee6f2 arm: spear: Call the SPL 'SPL', not 'Xloader'
Rename Xloader as SPL in comments.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Miquel Raynal
aa13fa71ea arm: spear: Drop useless board_init_r call
It is clearly stated that board_init_f should *not* call
board_init_r. Indeed, board_init_f should return. The code will
continue through arch/arm/lib/crt0.S which will do more setup before
calling board_init_r.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11 10:05:15 -04:00
Ramon Fried
f2a55acfcf test: pci_ep: add basic pci_ep tests
Add basic PCI endpoint sandbox testing.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-11 10:05:15 -04:00
Ramon Fried
bb41333782 pci_ep: add pci endpoint sandbox driver
Add a dummy PCI endpoint for sandbox.
Supporting only a single function, it allows setting
and reading header configuration.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-11 10:05:15 -04:00
Baruch Siach
cc66ebdeec arm: mvebu: set 38x and 39x AVS on lower frequency
Reduce Auto Voltage Scaling VDD limit when core frequency is lower than
1600MHz. This reduces core voltage level from 1.25V to 1.15V, which
saves power.

The code is taken from Marvell's U-Boot 2013.01 revision 18.06.

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:03 +02:00
Pascal Linder
fd9d70d738 km/spi: remove deprecated SPI flash driver code for KM Kirkwood boards
KM Kirkwood boards now implement the driver model for its SPI flash
interface. Therefore, the old board specific claim and release functions
can be deleted. The preprocessor definition CONFIG_SYS_KW_SPI_MPP is yet
unused as well. All its appearances and dependencies are removed in the
kirkwood_spi driver, header files and finally the configuration whitelist.

Signed-off-by: Pascal Linder <pascal.linder@edu.hefr.ch>
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:03 +02:00
Pascal Linder
c85306345a km/spi: add SPI configuration to KM Kirkwood device tree
In order to migrate the SPI flash interface to the driver model, the SPI
configuration needs to be added in the KM Kirkwood device tree file.

Signed-off-by: Pascal Linder <pascal.linder@edu.hefr.ch>
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:03 +02:00
Pascal Linder
c0fed3ac25 km: modify Kconfig file organization for KM boards
As preparation for the upcoming transferring of configurations from header
files to Kconfig, a common Kconfig file for all KM boards was created. For
the moment, it only sources the other three, more specific, Kconfig files.
Therefore, the architecture Kconfig files now include the common Kconfig
file. Also, the configuration selection for KM boards was moved from the
architecture Kconfig files to the board specific Kconfig files.

Signed-off-by: Pascal Linder <pascal.linder@edu.hefr.ch>
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:03 +02:00
Baruch Siach
22c47f6bbe arm: mvebu: clearfog: enable SATA in SPL
Enable SATA peripherals in SPL to allow boot from SATA.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:02 +02:00
Baruch Siach
22c654557f arm: mvebu: add support for boot from SATA
Add the required Kconfig and macro definitions to allow boot from SATA
on Armada 38x systems.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:02 +02:00
Baruch Siach
f0aa125477 arm: mvebu: fix ahci mbus config in SPL
SPL does not initialize mbus_dram_info. Don't change the ahci mbus
settings of the ROM. This allows the ahci to work in SPL.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11 10:58:02 +02:00
Alex Marginean
21ebbafde8 test: dm: Add a test for PCI Enhanced Allocation
This test is built on top of the existing swap_case driver.  It adds EA
capability structure support to swap_case and uses that to map BARs.
BAR1 works as it used to, swapping upper/lower case.  BARs 2,4 map to a
couple of magic values.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-10 16:52:58 -06:00
Patrick Delaunay
099ed45c6c test: check u-boot properties in SPL device tree
Add a test to check the management of the U-boot relocation properties
for device tree SPL generation (fdtgrep result) and platdata:
- 'dm-pre-proper' and 'dm-tpl' not included in SPL
- 'dm-pre-reloc' and 'dm-spl' included in SPL

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
44c6a0ed6e x86: Add a forward struct declaration in coreboot_tables.h
This struct is not defined in this header file. Add a forward declaration
so that it can be included in any context.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-10 16:52:58 -06:00
Simon Glass
24c2776ba9 sandbox: Correct spi flash operation
Since the SPI nor conversion, 'sf probe' does not work on sandbox. Fix
this by using the expected compatible string in the flash node.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: cd35365762 (mtd: sf_probe: remove spi-flash compatible)
2019-07-10 16:52:58 -06:00
Simon Glass
e676f4397c sandbox: Add a memory {} node
Add a memory node which indicates the size of sandbox memory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
e8a7b3051b sandbox: Allo sdl-config to be overridden
When cross-compiling, sometimes sdl-config must come from a different path
from the default. Add a way to override it, by adding SDL_CONFIG to the
environment before building U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
912dcb1b17 sandbox: Add a comment to board_init_f()
This function is used for both SPL and TPL. Add a comment to that effect.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
3f2f5cf62a sandbox: spl: Lower priority of standard loader
We normally want to load U-Boot from SPL, but if a board wants to do
something else, it is currently not possible since the standard loader
has the top priority. Lower it to allow other SPL_LOAD_IMAGE_METHOD()
declarations to override it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
9072326a6a sandbox: Exit when SYSRESET_POWER_OFF is requested
At present this returns but it seems better to just exit sandbox
immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>

reset
2019-07-10 16:52:58 -06:00
Simon Glass
87dac6b074 sandbox: Add an alias for SPI
At present 'sf probe' does not work since it cannot find SPI bus 0. Add
an alias to correct this, now that we no-longer have the --spi_sf option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
dc8c91abb7 sandbox: Create a common sandbox DT
At present sandbox and sandbox64 have duplicated nodes. This is hard to
maintain since changes in one need to be manually added to the other.

Create a common file to solve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Simon Glass
e8726da226 sandbox: Sync up sandbox64.dts with main DT
Various nodes have been added and adjusted with sandbox. Move these
changes over to sandbox64.dts to keep these in sync.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10 16:52:58 -06:00
Masahiro Yamada
2ce6b82d34 ARM: uniphier: set {kernel, ramdisk, fdt}_addr_r at boot-time
The base of DRAM will be changed for the next generation SoC.
The addresses needed for booting the kernel should be shifted
according to the DRAM base.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:09 +09:00
Masahiro Yamada
7095678787 ARM: uniphier: set dram_base environment variable
The base of DRAM will be changed for the next generation SoC.

Set the base address to the 'dram_base' environment variable, which
will be useful for scripting.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:08 +09:00
Masahiro Yamada
3cc936d8ab ARM: uniphier: set loadaddr at boot-time
The base of DRAM will be changed for the next generation SoC.
To support it along with existing SoCs in the single defconfig,
set 'loadaddr' at boot-time by adding the offset to the DRAM base.

CONFIG_SYS_LOAD_ADDR is still hard-coded for compilation, but the
value from environment variable 'loadaddr' should be used.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:07 +09:00
Masahiro Yamada
72cd83ab81 ARM: uniphier: turn uniphier_set_fdt_file() into void function
For consistency with a function that will be added.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:07 +09:00
Masahiro Yamada
1f8357c3ab ARM: uniphier: remove CONFIG_SYS_SDRAM_BASE
The base address of DRAM was 0x80000000 for all the ARM SoCs of this
family in the past. It will be changed to 0x20000000 for a planned new
SoC. To support multiple SoCs by the single uniphier_v8_defconfig, the
base must be run-time determined.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:06 +09:00
Masahiro Yamada
34e29f7d94 ARM: uniphier: make mem_map run-time configurable
Currently, mem_map is hard-coded, and it worked well until the last
SoC. For a planned new SoC, the addresses of peripherals and DRAM
will be changed. Set it up run-time.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:05 +09:00
Masahiro Yamada
df72534121 ARM: uniphier: make dram_init() more generic
Make this function work with any channel being empty.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:05 +09:00
Masahiro Yamada
6f47c99423 ARM: uniphier: make dram_init() independent of SG_MEMCONF
Currently, dram_init() code relies on the fact the DRAM size
configuration exists in the SG_MEMCONF register.

This will no longer be true for a planned new SoC, which will
replace SG_MEMCONF with a different register.

Refactor the hook in a more generic way.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:04 +09:00
Masahiro Yamada
34ded87506 ARM: uniphier: detect register base addresses run-time
Until the last SoC, the register addresses have been hard-coded because
they are always constant. For a planned new SoC, the register bases
will be completely changed. I insist on supporting multiple SoCs/boards
by a single defconfig (uniphier_v8_defconfig) since duplicating similar
defconfig files is a maintenance burden. The base addresses must be
fixed-up at run-time somehow.

Previously, the board init code identified the SoC by reading out the
SG_REVISION register. This is much easier than parsing DT.

You cannot do it any more because the base address of SG will be
changed. The SG_REVISION register exists to read out the SoC ID, but
you never know its address before identifying the SoC. Oh well.

So, the possible solution is to parse the DT, and find out the node
with "*-soc-glue" compatible string. Then, sg_base is set to the value
of the "reg" property. The sc_base is set up likewise.

It is worth noting a pit-fall. Having sc_base and sg_base in the global
scope will make the life easier, but the global variables are poorly
supported before the relocation. In fact, the .bss section overwraps
with DT. Allocating them in the .bss section would break DT. So, I gave
dummy initializers to assign them in the .data section.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:03 +09:00
Masahiro Yamada
739ba41d5a ARM: uniphier: de-couple SC macros into base address and offset
The SC_* macros represent the address of SysCtrl registers.
For a planned new SoC, its base address will be changed.

Turn the SC_* macros into the offset from the base address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:02 +09:00
Masahiro Yamada
d41b358fb3 ARM: uniphier: de-couple SG macros into base address and offset
The SG_* macros represent the address of SoC-glue registers.
For a planned new SoC, its base address will be changed.

Turn the SG_* macros into the offset from the base address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:00 +09:00
Masahiro Yamada
c3d8f1e8e9 ARM: uniphier: detect SD boot mode
The planned new SoC supports the SD boot mode. Detect and display it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:59 +09:00
Masahiro Yamada
539d6e0dbc ARM: uniphier: make boot_is_swapped() code optional
The planned new SoC does not have SBC (System Bus Controller) block.
Make boot_is_swapped() an optional hook.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:58 +09:00
Masahiro Yamada
f7f390576d ARM: uniphier: check DT to determine whether to initialize SBC
If CONFIG_MICRO_SUPPORT_CARD is enabled, U-Boot initialize SBC
(System Bus Controller), which may not be really necessary.

Check the "socionext,uniphier-system-bus" node in DT run-time.
If and only if it is found and its "status" property is okay,
initialize the SBC block.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:57 +09:00
Masahiro Yamada
92d6524b4f ARM: uniphier: check DT to determine whether to use support card
If CONFIG_MICRO_SUPPORT_CARD is enabled, U-Boot tries to get access
to the devices on the support card, which may not actually exist.

Check the DT and search for the on-board devices run-time. If the
nodes are not found in DT, then disable the code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:56 +09:00
Masahiro Yamada
b521ea3958 ARM: uniphier: include <linux/io.h> from boot-device.c
This file calls readl(), so needs to include <linux/io.h>.
Currently, it relies on someone else including it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:54 +09:00
Masahiro Yamada
ef866f6f48 ARM: uniphier: use bool type for have_internal_stm parameter
This is boolean logic.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:53 +09:00
Masahiro Yamada
a179669c4e ARM: uniphier: clean up clk/Makefile
Now that 64-bit SoCs of this SoC family no longer support SPL,
this Makefile can be slightly simpler.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:52 +09:00
Masahiro Yamada
40c1a466ce ARM: uniphier: remove unused uniphier_ld11_boot_device_fixup()
The .boot_device_fixup() is only called by SPL.

Now that 64-bit SoCs of this SoC family no longer support SPL,
debug-uart-ld20.c is never compiled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:52 +09:00
Masahiro Yamada
47eb8add27 arm64: dts: uniphier: add reserved-memory for secure memory
[ Linux commit aa38571246c6ac279ebebd141157297bcb959d76 ]

The memory regions specified by /memreserve/ are passed to
early_init_dt_reserve_memory_arch() with nomap=false, so it is
not suitable for reserving memory for Trusted Firmware-A etc.

Use the more robust /reserved-memory node with the no-map property
to prevent the kernel from mapping it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:41:50 +09:00
Masahiro Yamada
382de4a7e9 arm64: add an option to switch visibility of CONFIG_SYS_INIT_SP_BSS_OFFSET
By default, CONFIG_SYS_INIT_SP_BSS_OFFSET was made invisible by not
giving a prompt to it.

The only way to define it is to hard-code an extra entry in SoC/board
Kconfig, like arch/arm/mach-tegra/tegra{186,210}/Kconfig.

Add a prompt to it in order to allow defconfig files to specify the
value of CONFIG_SYS_INIT_SP_BSS_OFFSET.

With this, CONFIG_SYS_INIT_SP_BSS_OFFSET would become always visible.
So, we need a new bool option to turn it off by default.

I move the 'default 524288' to the common place. This value is not too
big, but is big enough to avoid the overwrap of DT in most platforms.
If 512KB is not a suitable choice for your platform, you can change it
from your defconfig or menuconfig etc.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
2019-07-10 22:37:23 +09:00
Tom Rini
b4944e2574 First set of u-boot-atmel features and fixes for 2019.10 cycle
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJdJEZEAAoJEB6zHgIOrC/I+LAH/jUDQpF5I68h0ZFGm3xoyGhm
 3CSv8viOm/kL+GLubjnv4cwAp8N8VRpeJekz0Jt1Xp8C6OIgtnJ2Fln72KD+Z0IC
 Rq7ByRS16iq4b6IUDRZObE4Jzxmf7rXU3jr0+/vd/en7kxVlvA9+Gsffs3OTGxC7
 z9PysRZPBMH/smIPXdEQxYifnbpDG4fmfGcUWKrYfkB0Kq6Ep98Ia/gXNCY8XJ/A
 sbNQGjJWJZWXS/TDetcC2VikssJ+yNFF34uzV+HD5Y3DW6ywLhuoDOz1pg8RR36i
 YjcTCQz8lL/UVaUzrGUgPVAC3gdKY6J26GtV3vZavxBcmtGf0FhVtXO/tZc9AsY=
 =6G45
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-atmel-2019.10-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel features and fixes for 2019.10 cycle

This includes the Atmel QSPI driver and support for the at91 boards.
This is the port of the driver from Linux, mostly done by Tudor Ambarus.
2019-07-09 08:17:12 -04:00
Cyrille Pitchen
4eeedd0306 ARM: dts: at91: sama5d2_xplained: fix QSPI0 node
Fix the following:
- use "jedec,spi-nor" binding, we use jedec compatible flashes
- set bus width to 4, we use quad capable flashes
- differentiate bewteen data and clk and cs pins
- drop partions as we don't use them in u-boot.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
[tudor.ambarus@microchip.com: use "jedec,spi-nor", edit commit message]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-07-09 09:26:43 +03:00
Tom Rini
0b7f1a95df - fix khadas-vim README
- add support for unique generated MAC adresses from SoC serial,
   limited to Amlogic GXL/GXM boards for now
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJdHgg6AAoJEHfc29rIyEnRjVkP/RmwsBgIdn/0LnuU5JQIcmNI
 S8fOV2u5YY4q4hX/5qgg6uN7/yONtiZjw4bxLJGLCj0SUQ6Tv8KgE+Jh1vswek6P
 ceOsIBfyg3ZX6INkH/moHH8/yl1NpirYjNGxw1Bg9ctBHPR9smQdh50pMyDy67mG
 E2Dja/TtOuggF6N98WSu1jB8UBA55CbEEBj1PkQt7K9bXJs9cEGSrpyZLEJvsRmL
 Pot1l1A9XKhRS3PylgoxmXWNXFD8wAk8LHEACUsxnybiWoIW5Dfao/4PSmPigXAp
 n9V3tU/OQECar0CKOtCod5pS5z8TVPuuaay/Y/+ijLlCktJBwkSaGWIhf9ILOjOW
 UTlcsFDR4KDqaEFKNDoOtOGYpczFrduU0b1hq1qu4hLV7YIxg738DoRr30JM5Lwa
 gJbUCHkPRnxVB3UztsctmQwZwfKmAdvd1CrzKqFBvemrQrf2AwfBweiAv8/AUzqq
 c7o0K0WdP/03CkmBU8KbyFn2N1X2VT1KlqgEVfRTq7UWTiLnS4j9AAiwNapGOb4M
 Ox7eODLbLw3UyZYjDuBHyPYa8uPhtVDpuFCPn2JnwFdbnT4kfE535pCKT/vbasYd
 0UQkgUPoIHm0VGhxv0hkjmrjqgv5CLQyAYhJVGATTH0Nc9dYGFKF/Gm6YIUpjUuW
 nhSh5HHVCg4dkogiMJ7u
 =BL1s
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20190704' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- fix khadas-vim README
- add support for unique generated MAC adresses from SoC serial,
  limited to Amlogic GXL/GXM boards for now
2019-07-08 16:02:19 -04:00
Tom Rini
f5e73a34ed Merge tag 'mmc-6-23' of https://github.com/MrVan/u-boot
- Pull in the series to split fsl_esdhc for i.MX/non-i.MX cleanly
2019-07-08 15:59:41 -04:00
Tom Rini
0bd2a92f54 - mtmips: network stability fixes for gardena-smart-gateway
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiQkHUH+J02LLC9InKPlOlyTyXBgFAl0fap8ACgkQKPlOlyTy
 XBiyKA/+M1xLnFgwaIeU9bs1xL7Mf9HgjK71+5znjlq3TPF0/cZp+ybSXmDGssX+
 j1r8E8yL7wpI/DwSAqLUVp31uwgdxjZglNNd6IdjSV0T5OgTXFh//L75ycMng/j2
 p4jICuDVcyyn+W7rJB+zY8ufbfmT1QRvD04ZwFD0AB38BMRME25zP30+AVQSP543
 yAu4b4cidJ8KHnji0zLRCwi3/BR2/LTxeizjL2SLumvBWZ1QGFvZSNc770Iak7dQ
 5Slund92QovV4jVaCBnEJjl4GAxggDQmiIqpPiJhbNhNSGAWRUR3BfM5gdtT5Xhg
 vY2flBGzZMKHDZWAFRp9YJ3B0gueUITAqviqXQyJknuOhsgEJYldT7+3zcjfwqNK
 X04Yn7AU96ivulRdnXEbd0L5Dc0BitOifu7bACeg7nR3XOWBSy5BhI4dI/BwHpkH
 Qe0gXtimyUhh2+I9LidP5m4CC9YQgJAqZhU76IY/WJEhO5Og0rSJ52N3waYj5opm
 eNqxsGwmRFdKm8uYwBC5Uv0nC/6ylLbPOKYVChFFe05pTIQuxLKO1qfttpHW8HX4
 YIVfRx1beMfQIQmaHiomjndoXqbuLkQnDt7ciEFqNHL4HHVKvj+0DIQWliZlWqZZ
 8Y72OuM6fZKrBuKILynnhI6PdwQiVxXxEiAmVFqhxEwtwnd2rP8=
 =Rpr+
 -----END PGP SIGNATURE-----

Merge tag 'mips-fixes-for-2019.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-mips

- mtmips: network stability fixes for gardena-smart-gateway
2019-07-08 07:29:33 -04:00
Weijie Gao
d24416c3fa arm: mediatek: remove arch_misc_init
The watchdog of mediatek chips is enabled by bootrom before u-boot is
running. Previously we choose to enable the wdt driver only to disable the
watchdog hardware.

Now wdt service is enabled by default. The function arch_misc_init which is
only used to disable wdt is no longer needed.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2019-07-07 17:38:55 -04:00
Tom Rini
e597e5b6bc Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
- DWC and i.MX6 fixes
2019-07-07 07:06:03 -04:00
Tom Rini
ace0d2ef2b Merge tag 'rockchip-for-v2019.07-rc5-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip 2019-07-07 07:05:47 -04:00
Tom Rini
54869e0811 - fix complation error for CONFIG_USB
- update RPi3 DTBs to v5.1-rc6 state
 - add defconfig for RPi3 B+
 - Fix BCM2835_MBOX_TAG_TEST_PIXEL_ORDER define
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEiUuSfQSYnG8EMsBltDliWyzx00MFAl0A9VQSHG1icnVnZ2Vy
 QHN1c2UuY29tAAoJELQ5Ylss8dNDyY8P/AsPYLpXkARV1UPaEr9m89uCnrXa0Ggm
 PBFiNUUmM/xRB6J9IQe1YnMio+azVvcpc1AkOTLG7ypgFxAiukfzDS1mnaQye8Mg
 Exq3GgrDZrLp1jXYXSf3EZgIbJhpejHf433frNoJkveq6GTPJpI0mpMsaDVkzy/Q
 jVKm4bLolyXkERIUcOvvhyTwyUJhJv7n6n3+yBMgfssZexhSCzf9nXI7Ds98mxaN
 UNrF6oqvKeICJpvGpfJ+sO4lzaWk/Uc5TEzJ9QnUn0bEePLjJY35H1C5Wmhfo4/L
 KHPGwFTVNvi2byXmht6UK+OWdp1D7NWF+il2dhJUm3kaURkYBVdKAmFd9SpevRX6
 SCsM5spkLeciVIc4keTgZI7yRcvkIq7qul9eCTQnviO/I3h1YykHMgWZjNDkY8ZG
 HhKSKRjpdT+BHq4mWca1Q29cpWwshgC01Vq8Pig/4EOoOSWJ79Y+Qm+xeOwDf2ph
 fRKP40Ves+ER/z+2tAAmj/wuKqD1B8UTIZ4i69lAUei5aSvTwpf1saEV3gIjoaqj
 5fhoCKamsQhXnv0DjYMliXHYZ78EZzZyh6Fr9LHFnlc861IrRawqTPjRuerdjGwd
 jrp/vhwv5regzfDmWGSVo1CCscWvXgf3Tfag2Uwc+u5lXOSgJd8XPZJFiRMGFBon
 fJN1lxjxLRQf
 =0ulJ
 -----END PGP SIGNATURE-----

Merge tag 'rpi-next-2019.07' of https://github.com/mbgg/u-boot

- fix complation error for CONFIG_USB
- update RPi3 DTBs to v5.1-rc6 state
- add defconfig for RPi3 B+
- Fix BCM2835_MBOX_TAG_TEST_PIXEL_ORDER define
2019-07-05 18:19:47 -04:00
Stefan Roese
9814fb272f mips: mt76xx: Implement new d-cache fix in last_stage_init()
With commit 06985289d4 ("watchdog: Implement generic watchdog_reset()
version") the init sequence has changed in arch_misc_init(), resulting
in a re-appearance of the d-cache issue on MT7688 boards (e.g. gardena).
When this happens, the first (or sometimes later ones as well) TFTP
command hangs and does not complete correctly. This leads to the
assumption that the d-cache is not in a clean state once the ethernet
driver is called (d-cache is used here for the buffers). The old work-
around with the cache flush somehow does not work any more now with
the new code change.

Unfortunately adding CONFIG_SYS_MALLOC_CLEAR_ON_INIT also did not fix
this issue. With v2019.07-rc3 it shows again. The time of accessing
the data seems to be very important here. It needs to be "very late"
in the boot process.

Testing has shown, that copying a 64KiB area in DDR at a very late
bootup time, directly before calling into the prompt, fixes this issue.
Flushing of the complete d-cache does not seem to necessary, as this
copy alone seems to fix this problem.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2019-07-05 17:12:27 +02:00
Jean-Jacques Hiblot
07e33711fe dm: Add a No-op uclass
This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-05 14:19:41 +02:00
Andy Yan
619f002db8 rockchip: make_fit_atf.py: fix loadables property set error
Commit b238e4b00c ("rockchip: Cleanup of make_fit_atf.py.") set
firmware = "atf_1";
loadables = "uboot","atf_1","atf_2";

Actually it should be:
firmware = "atf_1";
loadables = "uboot","atf_2","atf_3";

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-05 15:57:52 +08:00
Neil Armstrong
dad258fadd ARM: meson: add unique MAC address generation
Add support for generating an unique MAC address using the SoC internal
serial number from the Secure Monitor interface.

The algorithm generates an unicast locally administered 6bytes minus 2bits
address using an crc16 of the serial for the top 16bits with the lower 2 bits
masked to setup the unicast locally administered property and a crc24 for
the lower 24bits.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-04 16:04:59 +02:00
Neil Armstrong
0ef8e4069e ARM: meson: sm: Add secure monitor calls to retrieve SoC serial number
The Secure Monitor interface permits retrieving the SoC Serial Number,
add a function to retrieve it.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-04 16:04:59 +02:00
Fabio Estevam
5b85858251 wandboard: Add FIT image support
After the transition to DM, only the mx6dl/solo wandboard
is supported.

Add FIT image support so that all the wandboard variants
can be supported, like it was prior to the DM conversion.

Successfully booted Linux on mx6q/solo/qp wandboards.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:49 +02:00
Fabio Estevam
df51656986 wandboard: Add mmc0 alias
Add a mmc0 alias so that U-Boot proper can associate mmc0
with the boot SD card.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:49 +02:00
Fabio Estevam
6b573ed0bc wandboard: Import extra wandboard devicetree files
Import wandboard devicetree files so that the mx6q and mx6qp
variants can be properly supported.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:48 +02:00
Fabio Estevam
b76ba47cce wandboard: Sync with devicetree files from kernel 5.1.9
Udate the wandboard devicetree files with the ones
from kernel 5.1.9.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:48 +02:00
Fabio Estevam
ba18fdb312 mx6: dts: Move dtbs under SoC level
Place dtbs under SoC level rather than board level.

imx6q-novena.dtb and imx6dl-wandboard-revb1.dtb were
placed under the board config option, so move them
to SoC level.

This also aligns with the kernel dts Makefile format.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:48 +02:00
Fabio Estevam
7e8c2190c7 mx6: dts: Keep dtb entries sorted
Keep dtb entries sorted to help adding new dtbs
in an organized form.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2019-07-04 14:19:48 +02:00
Kever Yang
665ebcadd6 rockchip: rk3288: enable TPL for tinker-board
All the config for TPL has been update, we can enable the TPL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-02 11:49:49 +08:00
Kever Yang
e3f9a93e5a rockchip: dts: rk3288-tinker: enable sdmmc pinctrl node in spl
rockchip pinctrl driver has update to use dts, so we need
to add the pinctrl config in SPL for sdmmc.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-02 11:49:49 +08:00
Kever Yang
7e7f79207d rockchip: dts: tinker: migrate the dm-pre-reloc tag into -u-boot dts
Migrate all the "u-boot,dm-pre-reloc" tag from rk3288-tinker.dts
into rk3288-tinker-u-boot.dtsi.
When both board level and soc level '-u-boot.dtsi' files exist,
we need to include the soc level 'rk3288-u-boot.dtsi' manually.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-02 11:49:49 +08:00
Kever Yang
590dc42620 rockchip: dts: rk3288: move reloc tag into -u-boot dts
Move all the tag "u-boot,dm-pre-reloc" from rk3288.dtsi
into rk3288-u-boot.dtsi.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-02 11:49:49 +08:00
Kever Yang
45290847df rockchip: rk3288: add separate TPL STACK address
TPL is at SRAM while other stage is at SDRAM, so it needs
separate STACK.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-02 11:49:49 +08:00
Kever Yang
d18ca747b6 rockchip: rk3288: enable TPL configs to chip level
More boards other than vyasa needs TPL, so enable the TPL configs
at chip level instead of board level.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-02 11:49:49 +08:00
Mark Kettenis
5a6d960b22 rockchip: dts: rk3399: rockpro64: Provide init voltage
Add missing regulator-init-microvolt property to vdd_log regulator.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
(Rebase on latest u-boot-rockchip master)
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

Change-Id: I13b24fb81e8ad269d7dbb0c7b67f5f4795d2e775
2019-07-02 10:49:17 +08:00
Masahiro Yamada
69492fb4c5 ARM: uniphier: move sg_set_{pinsel, iectrl} to more relevant places
Move the sg_set_pinsel macro to arch/arm/mach-uniphier/arm32/debug_ll.S
since it is not used anywhere else.

Move the C functions sg_set_{pinsel,iectrl} to debug-uart.c since they
are not used anywhere else.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:18 +09:00
Masahiro Yamada
e3d5d3ac5b ARM: uniphier: remove unused init code for CONFIG_DEBUG_UART
debug_uart_init() is called from spl_board_init(), which is only
compiled for SPL. For U-boot proper, _debug_uart_init() is unreachable,
so dropped by the dead code elimination.

Now that 64-bit SoCs of this SoC family no longer support SPL,
debug-uart-ld20.c is never compiled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:18 +09:00
Masahiro Yamada
3b7fc3ff31 ARM: uniphier: include <linux/io.h> from dram_init.c
This file calls readl(), so needs to include <linux/io.h>.
Currently, it relies on someone else including it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:17 +09:00
Masahiro Yamada
139a94a986 ARM: uniphier: remove unused sg_set_iectrl_range()
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:16 +09:00
Masahiro Yamada
3f0d299e88 ARM: uniphier: remove unused SC_DPLLOSCCTRL
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:15 +09:00
Masahiro Yamada
caee7619a9 ARM: uniphier: fix build error for CONFIG_DEBUG_LL=y
Commit e27d6c7d32 ("ARM: uniphier: simplify SoC ID get function")
accidentally removed the macros needed to compile debug_ll.S

Revive them.

Fixes: e27d6c7d32 ("ARM: uniphier: simplify SoC ID get function")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-06-29 22:31:14 +09:00
Tom Rini
0352e878d2 Fixes for 2019.07
- menlo board
 - allow SDB on Sabre
 - HAB for mx6sl
 - apalis board
 -----BEGIN PGP SIGNATURE-----
 
 iQHDBAABCgAtFiEEiZClFGvhzbUNsmAvKMTY0yrV63cFAl0VwBcPHHNiYWJpY0Bk
 ZW54LmRlAAoJECjE2NMq1et3k4AL/iaMEhY5e43krMSmlnWDfS2DsTVpyUBX1Q7X
 JHkuKQ8iH3bBSquwLNFju2hGNK8whCHfsIB5QgSh4uK3JIzWAh+/5TCGXbPDkGMJ
 PI/hyxKy2EB245SMshcJMHbyLK6PeHi4V/WA4WyY2c91Dz/DNx7UhMZOlFm8wyMl
 TwDCwtlqHodz0tXKUziCjSqTfxj7WSThwuyQ0SEHAccglM1MzM1JHq1RcdV7Pjdh
 bDpMC0rjcxYl5MM7gIig5OMtx+26HgP6JM+QfeoEuBm0PbhxV6ZFyHlafb8W/ba0
 SjzMWIknZWYA9GTAkdUgN+E0ChZVID0oSVoVh51eKiOG1z+LpkJEKE7xsaCAeBiQ
 BupLRgd0tBtqVK345EFDCy5UkYrnkLOnI+3JQNZ9bxBoPmKAf6wvhqa9Jf3bc+rP
 iSYh9Lm3sWVlXKcLR4ltS39D48OT8GZqun8zLpZkwpAWxRMuFvR+R7Q+VMVKmEF2
 1dn3EJhMsvbmTj0lYRp+ObEEpJDL9A==
 =DFoX
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-20190628' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2019.07

- menlo board
- allow SDB on Sabre
- HAB for mx6sl
- apalis board
2019-06-28 08:00:22 -04:00
Tom Rini
cb8cc1d8fb STM32 MCU fixes/cleanup:
_ Fix SPL console for STM32F769 Discovery
 _ Fix Memory Protection Unit size for STM32F4 series
 _ Cleanup DT for STM32F746 Discovery
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEXyrViUccKBz9c35Jysd4L3sz/6YFAl0VyiEXHHBhdHJpY2Uu
 Y2hvdGFyZEBzdC5jb20ACgkQysd4L3sz/6YHxw//e+N2aQrdtioDGqHupwycdDWy
 323WMLCnbX6aGgHXMKCRT2X0I+gwQ1Me4Hc4LvwwbsiNoEfwvqR7mo0zE1uHs9kI
 aq+PPsxSyxvFDuT33WhtJqkXPKylMZpLt7HPeA2yuxuQKfLb1G/IqptPCJTbKNBp
 TywIUqYi/d59qkKVC6ohYFB+EigbNNy5Qm2EIxYgfUIsfHURycCX3czSHUyVU4Hn
 GkaBueTEgc1zCXq+yTEYe/0+ESlBpyZQmvf4midx6+knRw6IFy21QsReqNWMWV9H
 Tw6x5m+GpFru1N3kbldz+cfzRLTDjMDGTxT9Dv3JNvA3pu8Mo61esa7vwZnE3njD
 8BGSjwesSFL0i6KEvWc3Ir6U7F5P0wnI+FZ352ixGbleRiOCH6Gn8dpXY9xdPMFt
 m4XME44iXZZDtV9jqCdTNNBUOrp6ieQGOxvOhJAQDYgl0Cf+f2vYVAq7Q+wG8A99
 RdiZ8oLEn0e99aoKwUEj0VaNVMciSeInNif8TZlL2zduDO7gWtFeGIx3dDgzDYls
 0IyQdbUgwCBuZXc/zShaJKcbmdC2K/G/s6+bYyLk940ncLJPwyrNIGA7CK70vMr/
 MS4THwlVmpWm4SpiKXqyIJTPzKylYVXTxtnOvUc5lelkqKdARtYrBvxwnDXLtc2o
 DHJC1RtqlW7L9oEcci0=
 =5mJg
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-stm32-20190628' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

STM32 MCU fixes/cleanup:
- Fix SPL console for STM32F769 Discovery
- Fix Memory Protection Unit size for STM32F4 series
- Cleanup DT for STM32F746 Discovery
2019-06-28 07:59:38 -04:00
Patrice Chotard
36cb793b35 mach-stm32: Fix MPU region size dedicated to SDRAM for STM32F4
The MPU region dedicated for SDRAM for STM32F4 SoCs family
was set to 16MB, but STM32F429 Evaluation board have 32MB of SDRAM.

When kernel starts, only first 16MB of SDRAM are configured with XN
(eXecute Never) bit disabled, whereas kernel is using 32MB.
To avoid such situation in the future, extend this MPU region to 512MB
as for STM32F7/H7.

It fixes the following user land exception on STM32F429 Evaluation
board :

[    1.713002] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.722605] devtmpfs: mounted
[    1.733057] Freeing unused kernel memory: 72K
[    1.737622] This architecture does not have kernel memory protection.
[    1.744070] Run /sbin/init as init process
[    1.906850]
[    1.906850] Unhandled exception: IPSR = 00000004 LR = fffffffd
[    1.914282] CPU: 0 PID: 1 Comm: init Not tainted 5.1.0-00002-gcf9ca5719954 #6
[    1.921433] Hardware name: STM32 (Device Tree Support)
[    1.926601] PC is at 0x1a00b64
[    1.929642] LR is at   (null)
[    1.932669] pc : [<01a00b64>]    lr : [<00000000>]    psr: 01000000
[    1.938993] sp : 01a5cfb0  ip : 00000000  fp : 00000000
[    1.944269] r10: 01a43b00  r9 : 00000000  r8 : 00000000
[    1.949564] r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : 00000000
[    1.956168] r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : 00000000
[    1.962701] xPSR: 01000000
[    1.965506] CPU: 0 PID: 1 Comm: init Not tainted 5.1.0-00002-gcf9ca5719954 #6
[    1.972658] Hardware name: STM32 (Device Tree Support)
[    1.978132] [<0000c009>] (unwind_backtrace) from [<0000b24f>] (show_stack+0xb/0xc)
[    1.986024] [<0000b24f>] (show_stack) from [<0000b947>] (__invalid_entry+0x4b/0x4c)

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-06-28 09:45:27 +02:00
Patrice Chotard
1d3d87b41a ARM: dts: stm32: Remove useless u-boot, dm-pre-reloc in stm32f746-disco-u-boot.dtsi
As in stm32f7-u-boot.dtsi these nodes already have "u-bootdm-pre-reloc"
property, no need to add them again in stm32f746-disco-u-boot.dtsi.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-06-28 09:45:07 +02:00
Patrice Chotard
b8e8fdff29 ARM: dts: stm32: Add u-boot, dm-pre-reloc for usart1_pins_a for stm32f769-disco
This allow to get console output in SPL for stm32f769-disco.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-06-28 09:45:07 +02:00
Marek Vasut
26bb95f056 ARM: dts: imx: m53menlo: Import M53Menlo DT from Linux
Import iMX53 M53Menlo device tree from Linux next-20190607 3f310e51ceb1 .
Enable DT control in full U-Boot . Add U-Boot extras into separate DTSi,
the GPIO controllers need to be inited early, otherwise m53_set_clock()
won't be able to detect the correct CPU clock frequency by reading the
GPIO.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2019-06-27 14:14:23 +02:00
Marek Vasut
1d255904c3 ARM: dts: imx: imx53: Synchronize iMX53 DT with Linux
Synchronize iMX53 device tree from Linux next-20190607 3f310e51ceb1 ,
this is needed to get NFC, UART, USBOTG DT nodes.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2019-06-27 14:14:12 +02:00
Breno Matheus Lima
5760069ae8 mx6sl: hab: Fix pu_irom_mmu_enabled address
According to hab.c code we have to notify the ROM code if the MMU is
enabled or not. This is achieved by setting the "pu_irom_mmu_enabled"
to 0x1.

The current address in hab.c code is wrong for i.MX6SL, according to ROM
map file the correct address is 0x00901c60.

As we are writing in the wrong address the ROM code is not flushing the
caches when needed, and the following HAB event is observed in certain
scenarios:

--------- HAB Event 1 -----------------
event data:
        0xdb 0x00 0x14 0x41 0x33 0x18 0xc0 0x00
        0xca 0x00 0x0c 0x00 0x01 0xc5 0x00 0x00
        0x00 0x00 0x07 0xe4

STS = HAB_FAILURE (0x33)
RSN = HAB_INV_SIGNATURE (0x18)
CTX = HAB_CTX_COMMAND (0xC0)
ENG = HAB_ENG_ANY (0x00)

Update MX6SL_PU_IROM_MMU_EN_VAR to address this issue.

Reported-by: Frank Zhang <frank.zhang@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2019-06-27 14:10:40 +02:00
Jagan Teki
4977cf67de rockchip: rk3399: Enable TPL_BOARD_INIT
Enable TPL_BOARD_INIT, this would help us to show
TPL boot prints.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:29 +08:00
Jagan Teki
97d98e6bbf rockchip: rk3399: tpl: Mark printascii into debug
Now, we have spl_board_init which has TPL banner prints.

So mark the 'U-Boot TPL board init' print into debug.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:29 +08:00
Jagan Teki
c997c0fc28 rockchip: rk3399: tpl: Add spl_board_init
Add spl_board_init for TPL, that have TPL banner will help
to print tpl boot prints.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:28 +08:00
Jagan Teki
adde32d033 rockchip: rk3399: Enable SPL_BOARD_INIT
Enable SPL_BOARD_INIT globally to rk3399, this would
help to print the SPL banner during bootup.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:28 +08:00
Jagan Teki
16b0dd4cd1 rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2
u-boot,dm-pre-reloc for uart0, uart2 indeed u-boot specific
properties. Move them into rk3399-u-boot.dtsi so the boards
which enabled these node will available during SPL.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:28 +08:00
Jagan Teki
5e7216462b rockchip: rk3399: spl: Mark printascii into debug
Now, we have spl_board_init with preloader_console_init that
indeed show SPL banner.

So mark the 'U-Boot SPL board init' print into debug.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:28 +08:00
Jagan Teki
07586ee432 rockchip: rk3399: Support common spl_board_init
Support common spl_board_init by moving code from puma
board file into, common rk3399-board-spl.c.

Part of the code has sysreset-gpio, regulators_enable_boot_on
but right now only puma board is using this with relevant
config options rest remains common for all targets.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:28 +08:00
Jagan Teki
96070460c3 rockchip: rk3399: Get bl31.elf via BL31
Right now rockchip platform need to copy bl31.elf into u-boot
source directory to make use of building u-boot.itb.

So, add environment variable BL31 like Allwinner SoC so-that the
bl31.elf would available via BL31.

If the builds are not exporting BL31 env, the make_fit_atf.py
explicitly create dummy bl31.elf in u-boot root directory to
satisfy travis builds and it will show the warning on console as

 WARNING: BL31 file bl31.elf NOT found, resulting binary is non-functional
 WARNING: Please read Building section in doc/README.rockchip

Note, that the dummy bl31 files were created during not exporting
BL31 case would be removed via clean target in Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2019-06-26 21:11:27 +08:00
Matwey V. Kornilov
348a0b7f9e rockchip: dts: rk3328: add rk3328-rock64.dts
rk3328-rock64.dts has been taken from Linux kernel commit

    cff6d1d6f88b ("arm64: dts: rockchip: enable HS200 for eMMC on rock64")

with minor modifications (drop nodes not known by rk3328.dtsi).

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:26 +08:00
Kever Yang
c009aeb8ca rockchip: Kconfig: enable SPL support for rk3328
Enable SPL support and some related option in Kconfig.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
[cherry picked from 430b01462b with minor modifications]
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
2019-06-26 21:11:26 +08:00
Kever Yang
661519e5c5 rockchip: rk3328: add SPL board file support
rk3328 SPL is locate at dram, so do not have strict size limit,
suppose to enable storage media controller driver, load ATF and
U-Boot, then boot into ATF.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
[cherry picked from 4ebe3968b6 with minor modifications]
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-26 21:11:26 +08:00
Yangbo Lu
e37ac717d7 Convert to use fsl_esdhc_imx for i.MX platforms
Converted to use fsl_esdhc_imx for i.MX platforms.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Tested-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Martyn Welch <martyn.welch@collabora.com>
Acked-by: Jason Liu <Jason.hui.liu@nxp.com>
2019-06-23 14:18:34 +08:00
Andy Shevchenko
c974a3d155 watchdog: tangier: Convert to use WDT class
Convert legacy driver to use watchdog class.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2019-06-22 22:27:13 +08:00
Andy Shevchenko
7ce74b70b9 x86: Revert "Don't set up MTRRs in SPL"
This breaks Intel Edison to work. It gets laggish and unable to boot kernel.

Reverts commit 665cb18ea6 for now
till better solution will be proposed.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
2019-06-22 22:26:22 +08:00