[U-Boot] [PATCH 0/7] Exynos4412 SPL support
Anand Moon
linux.amoon at gmail.com
Mon Oct 29 07:45:31 UTC 2018
Hi Simon
On Fri, 14 Sep 2018 at 19:18, Simon Shields <simon at lineageos.org> wrote:
>
> Hi Anand,
>
> On Fri, Sep 14, 2018 at 05:31:38PM +0530, Anand Moon wrote:
> > Hi Simon,
> > On Fri, 14 Sep 2018 at 08:00, Simon Shields <simon at lineageos.org> wrote:
> > >
> > > Hi Anand,
> > >
> > > On Thu, Sep 13, 2018 at 08:39:52PM +0530, Anand Moon wrote:
> > > > Hi Simon,
> > > >
> > > > On Wed, 12 Sep 2018 at 17:25, Simon Shields <simon at lineageos.org> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > This patch series adds support for using U-Boot's SPL as the second
> > > > > stage bootloader ("BL2") on Exynos4412 SoCs.
> > > > >
> > > > > - Patch #1 adds support for the EMMC/SD OM pin configuration, which is used
> > > > > by the boards I tested on.
> > > > > - Patch #2 configures the magic values used to indicate system suspend
> > > > > state (which are identical to exynos5).
> > > > > - Patch #3 renames the existing exynos4 clock/dmc initialisation code
> > > > > to reflect the fact that it only supports exynos4210.
> > > > > - Patches #4 and #5 add/fill in structs reflecting the PMU and TZASC
> > > > > register layouts on exynos4412, respectively.
> > > > > - Patch #6 adds the exynos4412 DMC and clock initialisation code and
> > > > > enables building the SPL on exynos4412 platforms.
> > > > > - Patch #7 enables building the "mkexynosspl" utility for exynos4 SoCs.
> > > > >
> > > > > The majority of the logic in patch #6 comes from a vendor u-boot dump
> > > > > (2010.12!), however, small portions (mostly code used for 2GB RAM
> > > > > initialisation) were reverse engineered from the vendor
> > > > > bootloader found on a GT-N7100.
> > > > >
> > > > > This patch series has been tested on a GT-I9300 (exynos4412, 1GB RAM)
> > > > > and a GT-N7100 (exynos4412 prime, 2GB RAM), with a few additional
> > > > > patchsets applied for board/HW support (which I intend to upstream in
> > > > > the future).
> > > > >
> > > > > Cheers,
> > > > > Simon
> > > > >
> > > >
> > > > Could you elaborate more on how to generate stage bootloader (BL2) image,
> > > > I am not aware of such process and what are next step to create SPL
> > > > for Exynos platform.
> > > >
> > > > I have build these patches for Odroid-U3 boards, with no SPL enable.
> > >
> > > Of course!
> > >
> > > You need to add "select SUPPORT_SPL" to the relevant TARGET_ kconfig
> > > entry (e.g. [0]). Then, you need to configure the SPL suitably in
> > > include/configs/<target>.h - see [1], these values should not need
> > > changing between boards. Finally, you need to enable some SPL
> > > stuff in the defconfig (see [2]). That should allow u-boot to generate
> > > a SPL binary, which should go in spl/<target>-spl.bin.
> > >
> > > After that, you need to assemble an image suitable for flashing to an
> > > sdcard/eMMC. I use these two scripts [3], [4] combined with this BL1 [5]
> > > (originally from the ODROID-X u-boot sources, which no longer appear
> > > to be available) for eMMC and sdcard respectively.
> > >
> > > The usage of the script is:
> > >
> > > ./create_4412_<sd|emmc>_image.sh <bl1 binary> <spl binary> <u-boot.bin>
> > > <outfile>
> > >
> > > <outfile> can then be dd'd directly to an SD card or to the eMMC boot0
> > > partition.
> > >
> > > Hope that gets things working for you!
> > >
> > > Cheers,
> > > Simon
> > >
> > > >
> > > > Best Regards
> > > > -Anand
> > >
> > > [0]: https://github.com/fourkbomb/u-boot/blob/4be16a7/arch/arm/mach-exynos/Kconfig#L77
> > > [1]: https://github.com/fourkbomb/u-boot/blob/4be16a7/include/configs/midas.h#L31-L53
> > > [2]: https://github.com/fourkbomb/u-boot/blob/4be16a7/configs/midas_defconfig#L6-L10
> > > [3]: https://github.com/fourkbomb/buildroot-external-midas/blob/master/board/midas/create_4412_emmc_image.sh
> > > [4]: https://github.com/fourkbomb/buildroot-external-midas/blob/master/board/midas/create_4412_sd_image.sh
> > > [5]: https://github.com/fourkbomb/buildroot-external-midas/blob/master/board/midas/p4412_s_fwbl1.bin
> >
> > Thank you very much for this inside on building SPL image. I will give
> > this a try on Odroid U3.
> >
> > Do you have plan to add some low-level code to control clk memory cpu.
> >
> > [0] https://github.com/SamsungARTIK/u-boot-artik/tree/artik-exynos/v2012.07/board/samsung/smdk4x12
> >
> > Actually I failed to understand how the communication between the
> > kernel binary and u-boot with out this code.
>
> That code is not actually board-specific. It's added in patch #6.
> All the BL2 does is initialise clocks and memory (DMC), then load U-Boot from the appropriate
> boot medium.
>
> >
> > Also what about trusted zone, and do we need to get this spl image
> > signed by Samsung/Hardkernel to make this work.
>
> As with other Exynos SoCs in U-Boot, this doesn't support loading
> trustzone. As a result, you need to remove the "secure-firmware" node
> from the Linux kernel (you can also do it with CONFIG_OF_BOARD_SETUP[0]).
> Adding support for the TZSW could probably be done, but the goal here
> was to remove blobs from the boot process - so I don't really have
> any interest in adding TZSW support right now.
>
> >
> > Best Regards
> > -Anand
>
> Cheers,
> Simon
>
> [0]: https://github.com/fourkbomb/u-boot/blob/4be16a7/board/samsung/midas/midas.c#L377-L402
Adding samsung maintainers.
+ Minkyum and +Lukasz
Sorry for late testing of these patches
I manage to get the code compile on the my Archlinux Odroid U3 image
with some twerks in the u-boot.
with the new odroid
I am able to boot using u-boot up till loading of the kernel but it
failed to move ahead.
How can I debug this further.
------------------------------------------------------------
Starting Reboot...
[ 1613.704042] watchdog: watchdog0: nowayout prevents watchdog being stopped!
[ 1613.705323] watchdog: watchdog0: nowayout prevents watchdog being stopped!
[ 1613.712163] watchdog: watchdog0: watchdog did not stop!
[ 1613.718887] systemd-shutdow: 26 output lines suppressed due to ratelimiting
[ 1613.744412] systemd-shutdown[1]: Syncing filesystems and block devices.
U-Boot 2018.09-00275-g3502a38e59-dirty (Oct 29 2018 - 07:22:01 +0000)
CPU: Exynos4412 @ 1 GHz
Model: Odroid based on Exynos4412
Board: Odroid based on Exynos4412
Type: u3
DRAM: 2 GiB
LDO20 at VDDQ_EMMC_1.8V: set 1800000 uV; enabling
LDO22 at VDDQ_EMMC_2.8V: set 2800000 uV; enabling
LDO21 at TFLASH_2.8V: set 2800000 uV; enabling
MMC: SAMSUNG SDHCI: 1, EXYNOS DWMMC: 0
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - No block device, using default environment
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
732 bytes read in 5 ms (142.6 KiB/s)
## Executing script at 42000000
6355984 bytes read in 127 ms (47.7 MiB/s)
72400 bytes read in 122 ms (579.1 KiB/s)
5656893 bytes read in 117 ms (46.1 MiB/s)
## Flattened Device Tree blob at 40800000
Booting using the fdt blob at 0x40800000
Loading Ramdisk to 4fa9a000, end 4ffff13d ... OK
Loading Device Tree to 4fa85000, end 4fa99acf ... OK
Starting kernel ...
------------------------------------------------------------
Best Regards
-Anand
More information about the U-Boot
mailing list