Re: [U-Boot] [RFC PATCH v4 02/23] common: Make sure arch-specific map_sysmem() is defined
Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: In the case where the arch defines a custom map_sysmem(), make sure that including just common.h is sufficient to have these functions as they are when the arch does not override it. Signed-off-by: Joe Hershberger joe.hershber...@ni.com --- Changes in v4: -New to v4 Changes in v3: None Changes in v2: None include/common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index 77c55c6..6510efc 100644 --- a/include/common.h +++ b/include/common.h @@ -846,7 +846,9 @@ int cpu_release(int nr, int argc, char * const argv[]); #endif /* Define a null map_sysmem() if the architecture doesn't use it */ -# ifndef CONFIG_ARCH_MAP_SYSMEM +# ifdef CONFIG_ARCH_MAP_SYSMEM +#include asm/io.h +# else static inline void *map_sysmem(phys_addr_t paddr, unsigned long len) { return (void *)(uintptr_t)paddr; Do we need this patch? Is it just for sandbox? It would be nice to remove things from common.h rather than adding them! If you have a recommendation for where these static inline functions should move, then I'm happy to move it all to a new place. My assertion is that whatever it is that you include to get these static inlines should also be what you include when CONFIG_ARCH_MAP_SYSMEM is defined. You should not need to include the arch-specific header separately each place that one of these mapping functions is used. Anyway if you want to go ahead I'm OK with it. Reviewed-by: Simon Glass s...@chromium.org Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request: u-boot-sh/master
Dear Tom Rini. Please pull u-boot-sh master branch. The following changes since commit 50bb94c9496113c8bb588c4d82f3d6c61279dc02: OMAP3: igep0032: Fix regression due commit f3b4bc45. (2015-02-24 17:04:00 -0500) are available in the git repository at: git://git.denx.de/u-boot-sh.git master for you to fetch changes up to c3dd82386493d67cc5b0de06876360a27224b620: sh: enable CONFIG_USE_PRIVATE_LIBGCC by default (2015-02-25 13:57:56 +0900) Masahiro Yamada (3): sh: rename some private libraries sh: import missing private libraries from Linux 3.19 sh: enable CONFIG_USE_PRIVATE_LIBGCC by default Nobuhiro Iwamatsu (1): serial: sh: Remove invalid UTF-8 character Vladimir Barinov (1): serial: sh: fix internal clock source on SCIF arch/sh/Kconfig | 3 + arch/sh/lib/Makefile | 13 +++- arch/sh/lib/{ashiftlt.S = ashlsi3.S} | 0 arch/sh/lib/ashrdi3.c | 27 +++ arch/sh/lib/{lshiftrt.S = lshrsi3.S} | 0 arch/sh/lib/udiv_qrnnd.S | 60 arch/sh/lib/udivsi3.S | 66 + arch/sh/lib/udivsi3_i4i-Os.S | 128 + arch/sh/lib/udivsi3_i4i.S | 644 + drivers/serial/serial_sh.c| 2 +- drivers/serial/serial_sh.h| 5 +- 11 files changed, 943 insertions(+), 5 deletions(-) rename arch/sh/lib/{ashiftlt.S = ashlsi3.S} (100%) create mode 100644 arch/sh/lib/ashrdi3.c rename arch/sh/lib/{lshiftrt.S = lshrsi3.S} (100%) create mode 100644 arch/sh/lib/udiv_qrnnd.S create mode 100644 arch/sh/lib/udivsi3.S create mode 100644 arch/sh/lib/udivsi3_i4i-Os.S create mode 100644 arch/sh/lib/udivsi3_i4i.S -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Housekeeping
Hey all, I'll have more to say Monday morning (US) but since I see a lot of pull requests coming in now that (unrelated!) the mailing list is un-stuck I want to let everyone know that while my email address has changed my commitment to U-Boot has not. Please use tr...@konsulko.com instead of my TI address and I'll be updating relevant files soon. And nothing going to me and the list has been lost, I'll be catching up and posting shortly. Thanks all! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 17/23] dm: eth: Add support for ethprime env var
On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: The ethprime env var is used to indicate the starting device if none is specified in ethact. Also support aliases specified in the ethprime var. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v4: -Load from ethprime on eth_initialize() Changes in v3: -Added support for ethprime Changes in v2: None net/eth.c | 29 - test/dm/eth.c | 20 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/net/eth.c b/net/eth.c index 8b853e8..3b3cd84 100644 --- a/net/eth.c +++ b/net/eth.c @@ -341,6 +341,18 @@ int eth_initialize(void) printf(No ethernet found.\n); bootstage_error(BOOTSTAGE_ID_NET_ETH_START); } else { + char *ethprime = getenv(ethprime); + struct udevice *prime_dev = NULL; + + if (ethprime) + prime_dev = eth_get_dev_by_name(ethprime); + if (prime_dev) { + eth_set_dev(prime_dev); + eth_current_changed(); + } else { + eth_set_dev(NULL); + } + bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT); do { if (num_devices) @@ -348,6 +360,9 @@ int eth_initialize(void) printf(eth%d: %s, dev-seq, dev-name); + if (ethprime dev == prime_dev) + printf( [PRIME]); + eth_write_hwaddr(dev); uclass_next_device(dev); @@ -896,8 +911,20 @@ void eth_set_current(void) act = getenv(ethact); env_changed_id = env_id; } - if (act != NULL) + + if (act == NULL) { + char *ethprime = getenv(ethprime); + struct udevice *dev = NULL; + + if (ethprime) + dev = eth_get_dev_by_name(ethprime); This function can return either a net_device or a udevice. So if DM_ETH is not enabled, you will get a warning here. Yes, my apologies.I didn't notice this regression until right after I posted the series. It is fixed in my branch. + if (dev) + eth_set_dev(dev); + else + eth_set_dev(NULL); + } else { eth_set_dev(eth_get_dev_by_name(act)); + } eth_current_changed(); } diff --git a/test/dm/eth.c b/test/dm/eth.c index 5688b71..96e3c46 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -60,3 +60,23 @@ static int dm_test_eth_alias(struct dm_test_state *dms) return 0; } DM_TEST(dm_test_eth_alias, DM_TESTF_SCAN_FDT); + +static int dm_test_eth_prime(struct dm_test_state *dms) +{ + NetPingIP = string_to_ip(1.1.2.2); + + /* Expected to be eth@10003000 because of ethprime variable */ + setenv(ethact, NULL); + setenv(ethprime, eth5); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10003000, getenv(ethact)); + + /* Expected to be eth@10002000 because it is first */ + setenv(ethact, NULL); + setenv(ethprime, NULL); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10002000, getenv(ethact)); + + return 0; +} +DM_TEST(dm_test_eth_prime, DM_TESTF_SCAN_FDT); -- 1.7.11.5 Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels
On Sat, 28 Feb 2015 16:18:16 + Ian Campbell ijc+ub...@hellion.org.uk wrote: On Sat, 2015-02-21 at 11:49 +0100, Hans de Goede wrote: On 21-02-15 11:26, Ian Campbell wrote: Speaking of which, if someone were to identify a suitable set of simple-fb backports for 3.16 and they are reasonably self contained I'd happily backport them to the kenrel which is going to be in the next Debian release too... You will need all patches by me and by Luc Verhaegen from here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/video/fbdev/simplefb.c As well as these dts patches: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=5790d4ee1e425fefef0e012d1415c25baeb9dae8 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=d501841fc42a97a8b69449135eadf6e9c4589a87 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=e53a8b2201384ee1a2cfd1609c9ffdf951b041a1 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=8efc5c2be5b29f7ceec83bb471da81690273e141 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=678e75d I inserted this one here so the following stuff would cherry-pick ok, I think that was the right thing to do. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=a9f8cda32a3acc3150755fe973f7fa1867a7a5d6 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=8cedd6628472aa2d8f2f54dfcc36633e46a59db8 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fd18c7eac03540654abdbfedd52e6dfb3718b489 Those combined with a new enough u-boot should get you video output on most devices supported in upstream u-boot. Indeed, this gets me graphics on my Cubietruck at least. Thanks! This looks great, thanks. The video output support in Debian is going to be very much appreciated. It looks like I don't really need to do anything other than just installing the U-Boot bootloader by http://lists.denx.de/pipermail/u-boot/2015-January/202306.html https://github.com/ssvb/sunxi-bootsetup/releases/tag/20141215-sunxi-bootsetup-prototype And can simply delegate everything else to the Debian installer :-) Just one suggestion. It would be really nice if the Debian installer could present itself on all the available consoles, so that the user can use any of them for providing input to the installer. Otherwise there will be a need to provide separate SD card images for the HDMI console (for the Raspberry Pi wannable competitors), the UART serial console (A10/A20 development boards without HDMI) and the USB OTG serial gadget console (for the tablets without HDMI). Instead of just having only a single SD card image to handle everything automatically. Oh, and one more suggestion. The SD card partitioning could be also improved in order to make it more user friendly. Right now the user may be confused by the Debian installer regarding what to do with the existing partition on the SD card (yes, it can be safely erased since the installer is running from RAM and does not rely on the data from that partition anymore). -- Best regards, Siarhei Siamashka ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request: u-boot-sh/rmobile
Dear Tom Rini. Please pull u-boot-sh rmobile branch. The following changes since commit 50bb94c9496113c8bb588c4d82f3d6c61279dc02: OMAP3: igep0032: Fix regression due commit f3b4bc45. (2015-02-24 17:04:00 -0500) are available in the git repository at: git://git.denx.de/u-boot-sh.git rmobile for you to fetch changes up to 275ec28eed3d09bd924457b02ce29203172ae808: arm: rmobile: silk: Add support SDHI (2015-02-25 14:20:10 +0900) Nobuhiro Iwamatsu (9): arm: rmobile: koelsch: Migrate serial driver to drivers model arm: rmobile: gose: Migrate serial driver to drivers model arm: rmobile: lager: Migrate serial driver to drivers model arm: rmobile: alt: Migrate serial driver to drivers model arm: rmobile: silk: Migrate serial driver to drivers model arm: rmobile: alt: Add support SDHI arm: rmobile: koelsch: Add support SDHI arm: rmobile: gose: Add support SDHI arm: rmobile: lager: Add support SDHI Vladimir Barinov (5): arm: rmobile: Add Porter board support arm: rmobile: silk: Fix GPIO4_31 initialization arm: rmobile: silk: Disable ethernet pins pull-up arm: rmobile: silk: fix typo in device declaration arm: rmobile: silk: Add support SDHI arch/arm/cpu/armv7/rmobile/Kconfig |6 +- arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c | 1001 +++- arch/arm/cpu/armv7/rmobile/pfc-r8a7794.c | 148 +- arch/arm/include/asm/arch-rmobile/r8a7794-gpio.h | 114 +- board/renesas/alt/alt.c | 69 +++- board/renesas/gose/gose.c| 81 ++ board/renesas/koelsch/koelsch.c | 86 ++ board/renesas/lager/lager.c | 73 - board/renesas/porter/Kconfig | 12 ++ board/renesas/porter/MAINTAINERS |6 + board/renesas/porter/Makefile| 10 ++ board/renesas/porter/porter.c| 228 +++ board/renesas/porter/qos.c | 1312 + board/renesas/porter/qos.h | 13 ++ board/renesas/silk/silk.c| 59 ++- configs/alt_defconfig|3 + configs/gose_defconfig |3 + configs/koelsch_defconfig|3 + configs/lager_defconfig |3 + configs/porter_defconfig |6 + configs/silk_defconfig |3 + include/configs/alt.h|6 +- include/configs/gose.h |9 +- include/configs/koelsch.h| 10 +- include/configs/lager.h |6 +- include/configs/porter.h | 112 + include/configs/rcar-gen2-common.h |2 + include/configs/silk.h |6 +- 28 files changed, 3349 insertions(+), 41 deletions(-) create mode 100644 board/renesas/porter/Kconfig create mode 100644 board/renesas/porter/MAINTAINERS create mode 100644 board/renesas/porter/Makefile create mode 100644 board/renesas/porter/porter.c create mode 100644 board/renesas/porter/qos.c create mode 100644 board/renesas/porter/qos.h create mode 100644 configs/porter_defconfig create mode 100644 include/configs/porter.h -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sun7i: Add support for the MK808C board
From: Marcus Cooper codekip...@gmail.com The MK808C is a Allwinner based Android TV dongle. It features a A20 SOC, 1G RAM, 8GB NAND, HDMI out, A/V out, 1 USB A, 1 USB mini OTG, Bluetooth and Wireless LAN. Signed-off-by: Marcus Cooper codekip...@gmail.com --- board/sunxi/MAINTAINERS | 5 + configs/MK808C_defconfig | 9 + 2 files changed, 14 insertions(+) create mode 100644 configs/MK808C_defconfig diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 9a287d3..ead09c9 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -105,6 +105,11 @@ M: Ian Campbell i...@hellion.org.uk S: Maintained F: configs/Mele_M5_defconfig +MK808C BOARD +M: Marcus Cooper codekip...@gmail.com +S: Maintained +F: configs/MK808C_defconfig + MSI-PRIMO73 BOARD M: Siarhei Siamashka siarhei.siamas...@gmail.com S: Maintained diff --git a/configs/MK808C_defconfig b/configs/MK808C_defconfig new file mode 100644 index 000..9048b9e --- /dev/null +++ b/configs/MK808C_defconfig @@ -0,0 +1,9 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,USB_EHCI +CONFIG_FDTFILE=sun7i-a20-mk808c.dtb ++S:CONFIG_ARM=y ++S:CONFIG_ARCH_SUNXI=y ++S:CONFIG_MACH_SUN7I=y ++S:CONFIG_DRAM_CLK=384 ++S:CONFIG_DRAM_ZQ=127 ++S:CONFIG_DRAM_EMR1=4 -- 2.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Basic A33 support including dram init available in my personal repo
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/bsp_for_a67. I've integrated it with mainline u-boot, still lot to do to post it to upstream Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0. The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda Regards, Vishnu Patekar ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] MIPS UHI spec
On Fri, Feb 27, 2015 at 2:44 AM, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote: 2015-02-26 19:23 GMT+01:00 Andrew Bresticker abres...@chromium.org: Hi, On Thu, Feb 26, 2015 at 4:37 AM, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote: 2015-02-26 11:17 GMT+01:00 Paul Burton paul.bur...@imgtec.com: On Thu, Feb 19, 2015 at 01:50:23PM +, Matthew Fortune wrote: Hi Daniel, The spec for MIPS Unified Hosting Interface is available here: http://prplfoundation.org/wiki/MIPS_documentation As we have previously discussed, this is an ideal place to define the handover of device tree data from bootloader to kernel. Using a0 == -2 and defining which register(s) you need for the actual data will fit nicely. I'll happily include whatever is decided into the next version of the spec. this originates from an off-list discussion some months ago started by John Crispin. (CC +John, Ralf, Jonas, linux-mips) (CC +Andrew, Ezequiel, James, James) On the talk of DT handover, this recent patchset adding support for a system doing so to Linux is relevant: http://www.linux-mips.org/archives/linux-mips/2015-02/msg00312.html I'm also working on a system for which I'll need to implement DT handover very soon. It would be very nice if we could agree on some standard way of doing so (and eventually if the code on the Linux side can be generic enough to allow a multiplatform kernel). +1. I would like to see this happen as well. to be conformant with UHI I propose $a0 == -2 and $a1 == address of DT blob. It is a simple extension and should not interfere with the various legacy boot interfaces. U-Boot mainline code is almost ready for DT handover. I have prepared a patch [1] which completes it by implementing my proposal. Hmm... we decided to follow the ARM convention here ($a0 = 0, $a1 = -1, $a2 = physical address of DTB), which is also what the BMIPS platform (submitted by Kevin) is using for DT handover. Is there already a platform using the protocol you described? no, but with its publication the MIPS UHI spec is kind of official. AFAIK patches to support UHI in gcc, gdb, U-Boot etc. are already submitted or prepared. Matthew suggested that new boot protocols should be compliant with UHI. I think the ARM convention does not fit to UHI. Ok, I think we can change the boot protocol on Pistachio to match UHI then. -Andrew ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Is patchwork down?
On Sun, Mar 1, 2015 at 1:08 PM, Simon Glass s...@chromium.org wrote: Hi, I don't see mailing list patches appearing as normal on patchwork. Good question, Jeremy, is something up? Thanks! -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sun6i: Add support for the Mele I7 board
From: Marcus Cooper codekip...@gmail.com The Mele I7 is a Allwinner based Android TV box. It features a A31 SOC, 1G RAM, 8GB NAND, HDMI out, A/V out, SPDIF, IrDA, 3 USB A, 1 USB micro OTG and Wireless LAN. Signed-off-by: Marcus Cooper codekip...@gmail.com --- board/sunxi/MAINTAINERS | 5 + configs/Mele_I7_defconfig | 20 2 files changed, 25 insertions(+) create mode 100644 configs/Mele_I7_defconfig diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index ead09c9..4c167f7 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -100,6 +100,11 @@ M: Aleksei Mamlin mamli...@gmail.com S: Maintained F: configs/Marsboard_A10_defconfig +MELE I7 BOARD +M: Marcus Cooper codekip...@gmail.com +S: Maintained +F: configs/Mele_I7_defconfig + MELE M5 BOARD M: Ian Campbell i...@hellion.org.uk S: Maintained diff --git a/configs/Mele_I7_defconfig b/configs/Mele_I7_defconfig new file mode 100644 index 000..1046694 --- /dev/null +++ b/configs/Mele_I7_defconfig @@ -0,0 +1,20 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS=USB_EHCI,SUNXI_GMAC +CONFIG_FDTFILE=sun6i-a31-i7.dtb ++S:CONFIG_ARM=y ++S:CONFIG_ARCH_SUNXI=y ++S:CONFIG_MACH_SUN6I=y ++S:CONFIG_DRAM_CLK=312 ++S:CONFIG_DRAM_ZQ=120 +# The Mele I7 uses 3.3V for general IO ++S:CONFIG_AXP221_DCDC1_VOLT=3300 +# Ethernet phy power ++S:CONFIG_AXP221_DLDO1_VOLT=3300 +# USB hub power ++S:CONFIG_AXP221_DLDO4_VOLT=3300 +# Wifi power ++S:CONFIG_AXP221_ALDO1_VOLT=3300 +# Vbus gpio for usb1 ++S:CONFIG_USB1_VBUS_PIN=PC27 +# No Vbus gpio for usb2 ++S:CONFIG_USB2_VBUS_PIN= -- 2.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request: u-boot-sh/master
Add Tom's other mail address. 2015-03-02 10:25 GMT+09:00 Nobuhiro Iwamatsu iwama...@nigauri.org: Dear Tom Rini. Please pull u-boot-sh master branch. The following changes since commit 50bb94c9496113c8bb588c4d82f3d6c61279dc02: OMAP3: igep0032: Fix regression due commit f3b4bc45. (2015-02-24 17:04:00 -0500) are available in the git repository at: git://git.denx.de/u-boot-sh.git master for you to fetch changes up to c3dd82386493d67cc5b0de06876360a27224b620: sh: enable CONFIG_USE_PRIVATE_LIBGCC by default (2015-02-25 13:57:56 +0900) Masahiro Yamada (3): sh: rename some private libraries sh: import missing private libraries from Linux 3.19 sh: enable CONFIG_USE_PRIVATE_LIBGCC by default Nobuhiro Iwamatsu (1): serial: sh: Remove invalid UTF-8 character Vladimir Barinov (1): serial: sh: fix internal clock source on SCIF arch/sh/Kconfig | 3 + arch/sh/lib/Makefile | 13 +++- arch/sh/lib/{ashiftlt.S = ashlsi3.S} | 0 arch/sh/lib/ashrdi3.c | 27 +++ arch/sh/lib/{lshiftrt.S = lshrsi3.S} | 0 arch/sh/lib/udiv_qrnnd.S | 60 arch/sh/lib/udivsi3.S | 66 + arch/sh/lib/udivsi3_i4i-Os.S | 128 + arch/sh/lib/udivsi3_i4i.S | 644 + drivers/serial/serial_sh.c| 2 +- drivers/serial/serial_sh.h| 5 +- 11 files changed, 943 insertions(+), 5 deletions(-) rename arch/sh/lib/{ashiftlt.S = ashlsi3.S} (100%) create mode 100644 arch/sh/lib/ashrdi3.c rename arch/sh/lib/{lshiftrt.S = lshrsi3.S} (100%) create mode 100644 arch/sh/lib/udiv_qrnnd.S create mode 100644 arch/sh/lib/udivsi3.S create mode 100644 arch/sh/lib/udivsi3_i4i-Os.S create mode 100644 arch/sh/lib/udivsi3_i4i.S -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] please pull u-boot-samsung master
On Sat, Feb 28, 2015 at 07:06:11PM +0900, Minkyu Kang wrote: Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S I'm not seeing any of this when I try and pull master, did they end up in another branch? Thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 16/23] dm: eth: Add support for aliases
On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: Allow network devices to be referred to as eth0 instead of eth@12345678 when specified in ethact. Add tests to verify this behavior. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org Again a few comments on error handling for follow-up. --- Changes in v4: -Use only the seq from DM to find aliases Changes in v3: -Added support for aliases Changes in v2: None include/configs/sandbox.h | 2 +- include/net.h | 1 + net/eth.c | 47 ++- test/dm/eth.c | 24 test/dm/test.dts | 4 +++- 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 9189f6a..caf9f5a 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -174,7 +174,7 @@ #define SANDBOX_ETH_SETTINGS ethaddr=00:00:11:22:33:44\0 \ eth1addr=00:00:11:22:33:45\0 \ - eth2addr=00:00:11:22:33:46\0 \ + eth5addr=00:00:11:22:33:46\0 \ ipaddr=1.2.3.4\0 #define CONFIG_EXTRA_ENV_SETTINGS SANDBOX_SERIAL_SETTINGS \ diff --git a/include/net.h b/include/net.h index 508c572..e9cb4a3 100644 --- a/include/net.h +++ b/include/net.h @@ -122,6 +122,7 @@ struct eth_ops { #define eth_get_ops(dev) ((struct eth_ops *)(dev)-driver-ops) struct udevice *eth_get_dev(void); /* get the current device */ +struct udevice *eth_get_dev_by_name(const char *devname); This needs a comment to describe what devname is exactly. I thought it was a device name. OK Also it seems to requite a minimum length of 3 characters? Good point. This is a bug. I should be checking the size first. It is not an intended requirement. unsigned char *eth_get_ethaddr(void); /* get the current device MAC */ /* Used only when NetConsole is enabled */ int eth_init_state_only(void); /* Set active state */ diff --git a/net/eth.c b/net/eth.c index 9c2dfb9..8b853e8 100644 --- a/net/eth.c +++ b/net/eth.c @@ -132,6 +132,36 @@ static void eth_set_dev(struct udevice *dev) eth_get_uclass_priv()-current = dev; } +/* + * Find the udevice that either has the name passed in as devname or has an + * alias named devname. + */ +struct udevice *eth_get_dev_by_name(const char *devname) +{ + int seq; + char *endp = NULL; + const char *startp; + struct udevice *it; + struct uclass *uc; + + startp = devname + strlen(eth); + seq = simple_strtoul(startp, endp, 10); + + uclass_get(UCLASS_ETH, uc); + uclass_foreach_dev(it, uc) { + /* We need the seq to be valid, so make sure it's probed */ + device_probe(it); Error check. I think this function is should return an error. This is simply searching. If a device annot be probed, why error out a search for presumably a different device? I can look into adding a unit test to validate this behavior. + /* +* Check for the name or the sequence number to match +*/ + if (strcmp(it-name, devname) == 0 || + (endp startp it-seq == seq)) + return it; + } + + return NULL; +} + unsigned char *eth_get_ethaddr(void) { struct eth_pdata *pdata; @@ -405,6 +435,7 @@ UCLASS_DRIVER(eth) = { .pre_remove = eth_pre_remove, .priv_auto_alloc_size = sizeof(struct eth_uclass_priv), .per_device_auto_alloc_size = sizeof(struct eth_device_priv), + .flags = DM_UC_FLAG_SEQ_ALIAS, }; #endif @@ -437,6 +468,11 @@ static void eth_set_current_to_next(void) eth_current = eth_current-next; } +static void eth_set_dev(struct eth_device *dev) +{ + eth_current = dev; +} + struct eth_device *eth_get_dev_by_name(const char *devname) { struct eth_device *dev, *target_dev; @@ -853,7 +889,6 @@ void eth_set_current(void) { static char *act; static int env_changed_id; - void *old_current; int env_id; env_id = get_env_id(); @@ -861,14 +896,8 @@ void eth_set_current(void) act = getenv(ethact); env_changed_id = env_id; } - if (act != NULL) { - old_current = eth_get_dev(); - do { - if (strcmp(eth_get_name(), act) == 0) - return; -
[U-Boot] [PATCH v1]dm : spi: Convert Freescale DSPI to driver model
Move the Freescale DSPI driver over to driver model. Signed-off-by: Haikun Wang b53...@freescale.commailto:b53...@freescale.com --- This patch adds two new files drivers/spi/fsl_dspi.c and include/fsl_dspi.h. They will replace files drivers/spi/cf_spi.c and arch/m68k/include/asm/coldfire/dspi.h. I need submit patch to remove them later. Board dts files are also needed to make this change work. Changes in v1: None drivers/spi/Makefile | 1 + drivers/spi/fsl_dspi.c | 461 + include/fsl_dspi.h | 156 + 3 files changed, 618 insertions(+) create mode 100644 drivers/spi/fsl_dspi.c create mode 100644 include/fsl_dspi.h diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index edbd520..9c2b8de 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -49,3 +49,4 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o obj-$(CONFIG_ZYNQ_SPI) += zynq_spi.o obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o +obj-$(CONFIG_FSL_DSPI) += fsl_dspi.o diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c new file mode 100644 index 000..69c037b --- /dev/null +++ b/drivers/spi/fsl_dspi.c @@ -0,0 +1,461 @@ +/* + * (C) Copyright 2000-2003 + * Wolfgang Denk, DENX Software Engineering, w...@denx.demailto:w...@denx.de. + * + * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc. + * TsiChung Liew (tsi-chung.l...@freescale.commailto:tsi-chung.l...@freescale.com) + * Chao Fu (b44...@freescale.commailto:b44...@freescale.com) + * Haikun Wang (b53...@freescale.commailto:b53...@freescale.com) + * + * SPDX-License-Identifier:GPL-2.0+ + */ +#include dm.h +#include errno.h +#include common.h +#include spi.h +#include malloc.h +#include asm/io.h +#include fdtdec.h +#include asm/arch/clock.h +#include fsl_dspi.h + + +DECLARE_GLOBAL_DATA_PTR; + +/* fsl_dspi_platdata flag */ +#define DSPI_FLAG_REGMAP_ENDIAN_BIG(1 0) + +/* idle data value */ +#define DSPI_IDLE_VAL (0x0) + +/* max chipselect signals number */ +#define FSL_DSPI_MAX_CHIPSELECT(6) + +/* CTAR register pre-configure value */ +#define DSPI_CTAR_DEFAULT_VALUE(DSPI_CTAR_TRSZ(7) | \ + DSPI_CTAR_PCSSCK_1CLK | \ + DSPI_CTAR_PASC(0) | \ + DSPI_CTAR_PDT(0) | \ + DSPI_CTAR_CSSCK(0) | \ + DSPI_CTAR_ASC(0) | \ + DSPI_CTAR_DT(0)) + +/* CTAR register pre-configure mask */ +#define DSPI_CTAR_SET_MODE_MASK(DSPI_CTAR_TRSZ(15) | \ + DSPI_CTAR_PCSSCK(3) | \ + DSPI_CTAR_PASC(3) | \ + DSPI_CTAR_PDT(3) | \ + DSPI_CTAR_CSSCK(15) | \ + DSPI_CTAR_ASC(15) | \ + DSPI_CTAR_DT(15)) + +struct fsl_dspi_platdata { + uint flag; + uint baudrate; + uint num_chipselect; + uint regs; +}; + +struct fsl_dspi_priv { + uint mode; + uint mcr_val; + uint bus_clk; + uint baudrate; + uint charbit; + uint num_chipselect; + uint ctar_val[FSL_DSPI_MAX_CHIPSELECT]; + uint regs; + struct dm_spi_slave_platdata *cur_slave_plat; +}; + +static uint dspi_read32(struct udevice *bus, uint offset) +{ + struct fsl_dspi_platdata *plat = dev_get_platdata(bus); + return plat-flag DSPI_FLAG_REGMAP_ENDIAN_BIG ? + in_be32(plat-regs + offset) : in_le32(plat-regs + offset); +} + +static void dspi_write32(struct udevice *bus, uint offset, uint val) +{ + struct fsl_dspi_platdata *plat = dev_get_platdata(bus); + plat-flag DSPI_FLAG_REGMAP_ENDIAN_BIG ? + out_be32(plat-regs + offset, val) : + out_le32(plat-regs + offset, val); + return; +} + +static void dspi_halt(struct udevice *bus, u8 halt) +{ + uint mcr_val; + + mcr_val = dspi_read32(bus, DSPI_MCR); + + if (halt) + mcr_val |= DSPI_MCR_HALT; + else + mcr_val = ~DSPI_MCR_HALT; + + dspi_write32(bus, DSPI_MCR, mcr_val); + + return; +} + +static int fsl_dspi_child_pre_probe(struct udevice *dev) +{ + struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); + struct fsl_dspi_priv *priv = dev_get_priv(dev-parent); + + if (slave_plat-cs = priv-num_chipselect) { + printf(DSPI invalid chipselect number %d(max %d)!\n, + slave_plat-cs, priv-num_chipselect - 1); + return -EINVAL; + } + + priv-ctar_val[slave_plat-cs] = DSPI_CTAR_DEFAULT_VALUE; + + priv-cur_slave_plat = slave_plat; + + debug(DSPI pre_probe slave device on CS %u, max_hz %u, mode 0x%x.\n, + slave_plat-cs,
Re: [U-Boot] [PATCH v5] imx6: Added DEK blob generator command
Hi Raul, On Fri, Feb 27, 2015 at 2:22 PM, ulises.carde...@freescale.com wrote: From: Raul Cardenas ulises.carde...@freescale.com Freescale's SEC block has built-in Data Encryption Key(DEK) Blob Protocol which provides a method for protecting a DEK for non-secure memory storage. SEC block protects data in a data structure called a Secret Key Blob, which provides both confidentiality and integrity protection. Every time the blob encapsulation is executed, a AES-256 key is randomly generated to encrypt the DEK. This key is encrypted with the OTP Secret key from SoC. The resulting blob consists of the encrypted AES-256 key, the encrypted DEK, and a 16-bit MAC. During decapsulation, the reverse process is performed to get back the original DEK. A caveat to the blob decapsulation process, is that the DEK is decrypted in secure-memory and can only be read by FSL SEC HW. The DEK is used to decrypt data during encrypted boot. Commands added -- dek_blob - encapsulating DEK as a cryptgraphic blob Commands Syntax --- dek_blob src dst len Encapsulate and create blob of a len-bits DEK at address src and store the result at address dst. Signed-off-by: Raul Cardenas ulises.carde...@freescale.com Signed-off-by: Nitin Garg nitin.g...@freescale.com Signed-off-by: Ulises Cardenas ulises.carde...@freescale.com Signed-off-by: Ulises Cardenas-B45798 ulises.carde...@freescale.com It seems you have three Signed-off-by tags from yourself. You could put only one from yourself and one from Nitin. Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] sunxi: Support uploading 'boot.scr' to RAM over USB OTG in FEL mode
On Fri, 27 Feb 2015 16:39:45 + Ian Campbell ijc+ub...@hellion.org.uk wrote: On Tue, 2015-02-24 at 04:48 +0200, Siarhei Siamashka wrote: In order to fully support booting the whole system over USB OTG without relying on anything else (MMC, SATA, USB sticks, ...), it is possible to upload the 'boot.scr' file to DRAM using the 'fel' tool. But U-Boot still needs to be able to pick it up there before checking any other boot media. Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com --- The patch might be not the best way to implement this. But it would be great if U-Boot had out of the box support for: http://linux-sunxi.org/index.php?title=FEL/USBBootoldid=13134#Boot_the_whole_system_over_USB_.28u-boot_.2B_kernel_.2B_initramfs.29 One of the bad things about this patch is that the scriptaddr variable needs to be hardcoded and protected agaist modifications (if this address is to be used from the SPL). Perhaps use a separate dedicated/hardcoded address for the FEL boot script to avoid adding unusual semantics to $scriptaddr (which might surprise users not using fel)? Making something that is FEL-boot specific and diverges from the normal configuration is not great. Is there a real practical need for anyone to override $scriptaddr and the other similar variables in the environment? If not, marking them as read-only (similar to how the MAC address is handled) may be a reasonable solution. If the FEL address has to be 0x4310 for compatibility with existing instructions/tools that might mean moving the current scriptaddr elsewhere. I think we can live with that. There was an idea to make mksunxiboot tool store all these magic addresses into the bootable image, so that the fel tool could find them there. Some of such ideas are listed here: http://linux-sunxi.org/FEL/USBBoot#Potential_future_improvements_for_u-boot_v2015.07 This can only work if these addresses become compile time constants and can't be overridden by the environment. If the user really has a good reason to change them, making them configurable via menuconfig may be a solution. Also I'm not sure how this all could fit into the config_distro_bootcmd.h model, so I even have not tried that yet. Just at a quick glance, based on the PXE entry something like: #define BOOTENV_DEV_FEL(devtypeu, devtypel, instance) \ bootcmd_fel=source ...\0 i.e. all the magic params are irrelevant in this case. Perhaps bootcmd_#devtypel=...\0 but I don't think that's needed in this instance. BOOTENV_DEV_PXE doesn't bother at least. Then in BOOT_TARGET_DEVICES include func(FEL, fel, na) Well, in fact I'm not a big fan of the C preprocessor based approach used there. And if I understand it correctly, this is already causing some troubles for the A80 (sun9i) support: https://patchwork.ozlabs.org/patch/429463/ The C preprocessor surely can be used, but such code is barely maintainable. IMHO all the necessary adjustments to the environment variables can be done at runtime in the misc_init_r() function. For example, pre-pending fel to the boot_targets variable can be done based on a runtime check and activated only for the FEL mode. The C preprocessor constants are much less flexible. -- Best regards, Siarhei Siamashka ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 12/23] dm: eth: Add basic driver model support to Ethernet stack
Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: First just add support for MAC drivers. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org This looks right to me. I still have some comments on error handling, but I'm OK with you addressing these in a follow-on patch if you like. Thanks for going back and forth on this to make it right. --- Changes in v4: -Redo the seq / probe implementation --Don't prevent eth_initialize on driver model --Use eth_initialize to probe all devices and write_hwaddr --Look up MAC address in post-probe --Include ethprime handling in eth_initialize --If current == NULL, always check if there is a device available in eth_get_dev --Move env init call from uclass init to eth_initialize --Print the alias in eth_initialize -Stop handling selecting a new current in pre-unbind as it will now work itself out by clearing the pointer -Change -1 returns to error constants -Remove bd_t *bis from dm eth_ops init function -Add documentation to the structures -Add a helper function for eth_uclass_priv -Change puts to printf -Add eth_get_ops helper -Rename init() to start() in ops -Rename halt() to stop() in ops -Remove checks for driver==NULL -Remove priv pointer in per-device priv struct (drivers already get their own directly from DM) Changes in v3: -Correct the pre_unbind logic -Correct failure chaining from bind to probe to init --Fail init if not activated --Fail probe if ethaddr not set -Update ethaddr from env unconditionally on init -Use set current to select the current device regardless of the previous selection -Allow current eth dev to be NULL -Fixed blank line formatting for variable declaration Changes in v2: -Updated comments -Removed extra parentheses -Changed eth_uclass_priv local var names to be uc_priv -Update error codes -Cause an invalid name to fail binding -Rebase on top of dm/master -Stop maintaining our own index and use DM seq now that it works for our needs -Move the hwaddr to platdata so that its memory is allocated at bind when we need it -Prevent device from being probed before used by a command (i.e. before eth_init()). common/cmd_bdinfo.c| 2 + drivers/net/Kconfig| 5 + include/dm/uclass-id.h | 1 + include/net.h | 52 net/eth.c | 345 - 5 files changed, 399 insertions(+), 6 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index aa81da2..b4cce25 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -34,6 +34,7 @@ static void print_eth(int idx) printf(%-12s= %s\n, name, val); } +#ifndef CONFIG_DM_ETH __maybe_unused static void print_eths(void) { @@ -52,6 +53,7 @@ static void print_eths(void) printf(current eth = %s\n, eth_get_name()); printf(ip_addr = %s\n, getenv(ipaddr)); } +#endif __maybe_unused static void print_lnum(const char *name, unsigned long long value) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e69de29..bdd0f05 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -0,0 +1,5 @@ +config DM_ETH + bool Enable Driver Model for Ethernet drivers + depends on DM + help + Enable driver model for Ethernet. Here you could mention that the eth_...() interface is then implemented by the Ethernet uclass. Perhaps a few other notes too? See for example drivers/spi/Kconfig or drivers/gpio/Kconfig. OK diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 91bb90d..ad96682 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -34,6 +34,7 @@ enum uclass_id { UCLASS_I2C_GENERIC, /* Generic I2C device */ UCLASS_I2C_EEPROM, /* I2C EEPROM device */ UCLASS_MOD_EXP, /* RSA Mod Exp device */ + UCLASS_ETH, /* Ethernet device */ UCLASS_COUNT, UCLASS_INVALID = -1, diff --git a/include/net.h b/include/net.h index 10d38f8..508c572 100644 --- a/include/net.h +++ b/include/net.h @@ -78,6 +78,57 @@ enum eth_state_t { ETH_STATE_ACTIVE }; +#ifdef CONFIG_DM_ETH +/** + * struct eth_pdata - Platform data for Ethernet MAC controllers + * + * @iobase: The base address of the hardware registers + * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env + */ +struct eth_pdata { + phys_addr_t iobase; + unsigned char enetaddr[6]; +}; + +/** + * struct eth_ops - functions of Ethernet MAC controllers + * + * start: Prepare the hardware to send and receive packets + * send: Send the bytes passed in packet as a packet on the wire + * recv: Check
Re: [U-Boot] [RFC PATCH v4 10/23] net: Make netretry actually do something
Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: netretry previously would only retry in one specific case (your MAC address is not set) and no other. This is basically useless. In the DM implementation for eth it turns this into a completely useless case since an un-configured MAC address results in not even entering the NetLoop. The behavior is now changed to retry any failed command (rotating through the eth adapters if ethrotate != no). It also defaulted to retry forever. It is now changed to default to not retry That last bit seems like a big change. Does it mean that if I forget to plug in the Ethernet it might not recover? It seems like it at face value, but this actually is far closer to maintaining existing behavior. As described in the first paragraph, only a missing MAC address would be retried. all other forms of failure (unplugged Ethernet, for instance) would just error out. This provides a way to retry if that is a behavior you want. Most times if you ping an address, for instance, you would expect your script to get a failure code, not for the ping to be attempted on a different interface (which would become the new default behavior without this env var default also changing). ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 0/23] Add Driver Model support to network stack
On Sun, Mar 1, 2015 at 10:13 AM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: Add support for the Ethernet MAC controllers. Phy support will come later. I am still leaving this as an RFC because I plan to add real board support before committing to mainline. When it is acceptable / accepted, I will push it as a dev branch on the net repo until a real device is supported. If any required changes are discovered in the process of supporting a real device I will send those as a patch against the dev branch, but then squash before sending the non-RFC version. I plan to rebase when the merge window opens anyway. If desired, let me know which of the non-DM related prerequisite patches are wanted for this release. I've added unit tests to verify functionality. There is an additional driver for sandbox that bridges to the RAW Ethernet API in Linux which lets you test with real traffic. It now supports localhost as well (the 'lo' interface). I've got some comments queued up the the series so will send those soon (never got to it this week so am catching up!). I wanted to try it out on a board to see how things look. The short answer is that it works really nicely on sunxi. I'll send some patches that I needed, hopefully that doesn't duplicate any work you have done. It's great that works on your board without much effort. Looking at those patches I wouldn't say it duplicates much effort. It's more like your changes are a stop-gap to my efforts, which makes me less inclined to wait for all of the additional phy and mdio driver-model changes to be complete before integrating the dm-eth support to mainline. In terms of getting this into mainline, I'd be happy to use u-boot-dm/next if that suits you and Tom. There are series for PCI and USB to sort out, and if the last merge window is any indication it's a real struggle to get multiple large series applied within the merge window when there are dependencies between them. That makes sense to me. Since it is a next branch, we are still agreeing that the branch will be rebased on top of the release, correct? Some general comments that I will put here for want of a better place: - it would be good to have the DM code in drivers/net/eth-uclass.c at some point I completely agree. I moved it there probably 3 different times locally in slightly different ways and backed it out each time. I think it should be a follow-on clean-up patch. It makes this initial patch series messier than I wanted (hence I backed it out). That is the long-term goal. - struct eth_pdata is used by the uclass and is common to all drivers, but I wonder if we will find that drivers want to add their own private platdata? I added phy_interface but that is generic. Let's see. Yeah, I think that's something that can be revisited pretty easily if the need becomes clear. - I think the recv() method should change before long. The NetReceive() call should be made from the uclass since it is common to all drivers. Then the recv() method can return a packet if it finds one, but not submit it for processing I agree. I never liked how it was laid out and now is a great opportunity to change it since every driver has to be touched anyway. One interesting point for me is that you have taken a slightly more ambitious approach with the conversion by not reusing eth_device. That seems to have have worked out well and makes me think I could revisit SPI flash perhaps and do the same. I agree that it's nicer to get rid of the extra wrapping structure. Naturally the refactor could happen any time, but it seemed simple enough to just do now. Changes in v4: -New to v4 -Fix compile regression in !DM_ETH case -New to v4 -New to v4 -New to v4 -New to v4 -New to v4 If you put this in a patch, patman will remove duplicates in the cover letter. Series-process-log: uniq You can also sort with: Series-process-log: sort, uniq Thanks for the tip. Any reason these are not enabled by default? -Redo the seq / probe implementation --Don't prevent eth_initialize on driver model --Use eth_initialize to probe all devices and write_hwaddr --Look up MAC address in post-probe --Include ethprime handling in eth_initialize --If current == NULL, always check if there is a device available in eth_get_dev --Move env init call from uclass init to eth_initialize --Print the alias in eth_initialize -Stop handling selecting a new current in pre-unbind as it will now work itself out by clearing the pointer -Change -1 returns to error constants -Remove bd_t *bis from dm eth_ops init function -Add documentation to the structures -Add a helper function for eth_uclass_priv -Change puts to printf -Add eth_get_ops helper -Rename init() to start() in ops -Rename halt() to stop() in ops -Remove checks for driver==NULL -Remove priv pointer in
Re: [U-Boot] please pull u-boot-samsung master
+Tom On 28 February 2015 at 03:06, Minkyu Kang mk7.k...@samsung.com wrote: Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S -- Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request: u-boot-sh/rmobile
Add Tom's other mail address. 2015-03-02 10:47 GMT+09:00 Nobuhiro Iwamatsu iwama...@nigauri.org: Dear Tom Rini. Please pull u-boot-sh rmobile branch. The following changes since commit 50bb94c9496113c8bb588c4d82f3d6c61279dc02: OMAP3: igep0032: Fix regression due commit f3b4bc45. (2015-02-24 17:04:00 -0500) are available in the git repository at: git://git.denx.de/u-boot-sh.git rmobile for you to fetch changes up to 275ec28eed3d09bd924457b02ce29203172ae808: arm: rmobile: silk: Add support SDHI (2015-02-25 14:20:10 +0900) Nobuhiro Iwamatsu (9): arm: rmobile: koelsch: Migrate serial driver to drivers model arm: rmobile: gose: Migrate serial driver to drivers model arm: rmobile: lager: Migrate serial driver to drivers model arm: rmobile: alt: Migrate serial driver to drivers model arm: rmobile: silk: Migrate serial driver to drivers model arm: rmobile: alt: Add support SDHI arm: rmobile: koelsch: Add support SDHI arm: rmobile: gose: Add support SDHI arm: rmobile: lager: Add support SDHI Vladimir Barinov (5): arm: rmobile: Add Porter board support arm: rmobile: silk: Fix GPIO4_31 initialization arm: rmobile: silk: Disable ethernet pins pull-up arm: rmobile: silk: fix typo in device declaration arm: rmobile: silk: Add support SDHI arch/arm/cpu/armv7/rmobile/Kconfig |6 +- arch/arm/cpu/armv7/rmobile/pfc-r8a7790.c | 1001 +++- arch/arm/cpu/armv7/rmobile/pfc-r8a7794.c | 148 +- arch/arm/include/asm/arch-rmobile/r8a7794-gpio.h | 114 +- board/renesas/alt/alt.c | 69 +++- board/renesas/gose/gose.c| 81 ++ board/renesas/koelsch/koelsch.c | 86 ++ board/renesas/lager/lager.c | 73 - board/renesas/porter/Kconfig | 12 ++ board/renesas/porter/MAINTAINERS |6 + board/renesas/porter/Makefile| 10 ++ board/renesas/porter/porter.c| 228 +++ board/renesas/porter/qos.c | 1312 + board/renesas/porter/qos.h | 13 ++ board/renesas/silk/silk.c| 59 ++- configs/alt_defconfig|3 + configs/gose_defconfig |3 + configs/koelsch_defconfig|3 + configs/lager_defconfig |3 + configs/porter_defconfig |6 + configs/silk_defconfig |3 + include/configs/alt.h|6 +- include/configs/gose.h |9 +- include/configs/koelsch.h| 10 +- include/configs/lager.h |6 +- include/configs/porter.h | 112 + include/configs/rcar-gen2-common.h |2 + include/configs/silk.h |6 +- 28 files changed, 3349 insertions(+), 41 deletions(-) create mode 100644 board/renesas/porter/Kconfig create mode 100644 board/renesas/porter/MAINTAINERS create mode 100644 board/renesas/porter/Makefile create mode 100644 board/renesas/porter/porter.c create mode 100644 board/renesas/porter/qos.c create mode 100644 board/renesas/porter/qos.h create mode 100644 configs/porter_defconfig create mode 100644 include/configs/porter.h -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 12/23] dm: eth: Add basic driver model support to Ethernet stack
Hi Joe, On 1 March 2015 at 14:45, Joe Hershberger joe.hershber...@gmail.com wrote: Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: First just add support for MAC drivers. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org This looks right to me. I still have some comments on error handling, but I'm OK with you addressing these in a follow-on patch if you like. Thanks for going back and forth on this to make it right. I'm pleased to see it coming together. --- Changes in v4: -Redo the seq / probe implementation --Don't prevent eth_initialize on driver model --Use eth_initialize to probe all devices and write_hwaddr --Look up MAC address in post-probe --Include ethprime handling in eth_initialize --If current == NULL, always check if there is a device available in eth_get_dev --Move env init call from uclass init to eth_initialize --Print the alias in eth_initialize -Stop handling selecting a new current in pre-unbind as it will now work itself out by clearing the pointer -Change -1 returns to error constants -Remove bd_t *bis from dm eth_ops init function -Add documentation to the structures -Add a helper function for eth_uclass_priv -Change puts to printf -Add eth_get_ops helper -Rename init() to start() in ops -Rename halt() to stop() in ops -Remove checks for driver==NULL -Remove priv pointer in per-device priv struct (drivers already get their own directly from DM) Changes in v3: -Correct the pre_unbind logic -Correct failure chaining from bind to probe to init --Fail init if not activated --Fail probe if ethaddr not set -Update ethaddr from env unconditionally on init -Use set current to select the current device regardless of the previous selection -Allow current eth dev to be NULL -Fixed blank line formatting for variable declaration Changes in v2: -Updated comments -Removed extra parentheses -Changed eth_uclass_priv local var names to be uc_priv -Update error codes -Cause an invalid name to fail binding -Rebase on top of dm/master -Stop maintaining our own index and use DM seq now that it works for our needs -Move the hwaddr to platdata so that its memory is allocated at bind when we need it -Prevent device from being probed before used by a command (i.e. before eth_init()). common/cmd_bdinfo.c| 2 + drivers/net/Kconfig| 5 + include/dm/uclass-id.h | 1 + include/net.h | 52 net/eth.c | 345 - 5 files changed, 399 insertions(+), 6 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index aa81da2..b4cce25 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -34,6 +34,7 @@ static void print_eth(int idx) printf(%-12s= %s\n, name, val); } +#ifndef CONFIG_DM_ETH __maybe_unused static void print_eths(void) { @@ -52,6 +53,7 @@ static void print_eths(void) printf(current eth = %s\n, eth_get_name()); printf(ip_addr = %s\n, getenv(ipaddr)); } +#endif __maybe_unused static void print_lnum(const char *name, unsigned long long value) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e69de29..bdd0f05 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -0,0 +1,5 @@ +config DM_ETH + bool Enable Driver Model for Ethernet drivers + depends on DM + help + Enable driver model for Ethernet. Here you could mention that the eth_...() interface is then implemented by the Ethernet uclass. Perhaps a few other notes too? See for example drivers/spi/Kconfig or drivers/gpio/Kconfig. OK diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 91bb90d..ad96682 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -34,6 +34,7 @@ enum uclass_id { UCLASS_I2C_GENERIC, /* Generic I2C device */ UCLASS_I2C_EEPROM, /* I2C EEPROM device */ UCLASS_MOD_EXP, /* RSA Mod Exp device */ + UCLASS_ETH, /* Ethernet device */ UCLASS_COUNT, UCLASS_INVALID = -1, diff --git a/include/net.h b/include/net.h index 10d38f8..508c572 100644 --- a/include/net.h +++ b/include/net.h @@ -78,6 +78,57 @@ enum eth_state_t { ETH_STATE_ACTIVE }; +#ifdef CONFIG_DM_ETH +/** + * struct eth_pdata - Platform data for Ethernet MAC controllers + * + * @iobase: The base address of the hardware registers + * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env + */ +struct eth_pdata { + phys_addr_t iobase; + unsigned char enetaddr[6]; +}; + +/** + * struct eth_ops - functions of Ethernet MAC controllers + *
Re: [U-Boot] [RFC PATCH v4 10/23] net: Make netretry actually do something
Hi Joe, On 1 March 2015 at 14:53, Joe Hershberger joe.hershber...@gmail.com wrote: Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: netretry previously would only retry in one specific case (your MAC address is not set) and no other. This is basically useless. In the DM implementation for eth it turns this into a completely useless case since an un-configured MAC address results in not even entering the NetLoop. The behavior is now changed to retry any failed command (rotating through the eth adapters if ethrotate != no). It also defaulted to retry forever. It is now changed to default to not retry That last bit seems like a big change. Does it mean that if I forget to plug in the Ethernet it might not recover? It seems like it at face value, but this actually is far closer to maintaining existing behavior. As described in the first paragraph, only a missing MAC address would be retried. all other forms of failure (unplugged Ethernet, for instance) would just error out. This provides a way to retry if that is a behavior you want. Most times if you ping an address, for instance, you would expect your script to get a failure code, not for the ping to be attempted on a different interface (which would become the new default behavior without this env var default also changing). Thanks for explaining this. Reviewed-by: Simon Glass s...@chromium.org Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] please pull u-boot-samsung master
On 02/03/15 11:07, Tom Rini wrote: On Sat, Feb 28, 2015 at 07:06:11PM +0900, Minkyu Kang wrote: Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S I'm not seeing any of this when I try and pull master, did they end up in another branch? Thanks! sorry! I forgot push the master branch. Please retry. Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 0/23] Add Driver Model support to network stack
Hi Joe, On 1 March 2015 at 15:12, Joe Hershberger joe.hershber...@gmail.com wrote: On Sun, Mar 1, 2015 at 10:13 AM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: Add support for the Ethernet MAC controllers. Phy support will come later. I am still leaving this as an RFC because I plan to add real board support before committing to mainline. When it is acceptable / accepted, I will push it as a dev branch on the net repo until a real device is supported. If any required changes are discovered in the process of supporting a real device I will send those as a patch against the dev branch, but then squash before sending the non-RFC version. I plan to rebase when the merge window opens anyway. If desired, let me know which of the non-DM related prerequisite patches are wanted for this release. I've added unit tests to verify functionality. There is an additional driver for sandbox that bridges to the RAW Ethernet API in Linux which lets you test with real traffic. It now supports localhost as well (the 'lo' interface). I've got some comments queued up the the series so will send those soon (never got to it this week so am catching up!). I wanted to try it out on a board to see how things look. The short answer is that it works really nicely on sunxi. I'll send some patches that I needed, hopefully that doesn't duplicate any work you have done. It's great that works on your board without much effort. Looking at those patches I wouldn't say it duplicates much effort. It's more like your changes are a stop-gap to my efforts, which makes me less inclined to wait for all of the additional phy and mdio driver-model changes to be complete before integrating the dm-eth support to mainline. In terms of getting this into mainline, I'd be happy to use u-boot-dm/next if that suits you and Tom. There are series for PCI and USB to sort out, and if the last merge window is any indication it's a real struggle to get multiple large series applied within the merge window when there are dependencies between them. That makes sense to me. Since it is a next branch, we are still agreeing that the branch will be rebased on top of the release, correct? Yes, once it is in u-boot-dm/next I'll keep it rebased. But since we are at RC2 I don't expect much effort there. I want to do this because I originally planned to get PCI into the current release, but found there were just too many patches to respin and apply during the merge window, and I didn't get to it. This will make it easier. Some general comments that I will put here for want of a better place: - it would be good to have the DM code in drivers/net/eth-uclass.c at some point I completely agree. I moved it there probably 3 different times locally in slightly different ways and backed it out each time. I think it should be a follow-on clean-up patch. It makes this initial patch series messier than I wanted (hence I backed it out). That is the long-term goal. - struct eth_pdata is used by the uclass and is common to all drivers, but I wonder if we will find that drivers want to add their own private platdata? I added phy_interface but that is generic. Let's see. Yeah, I think that's something that can be revisited pretty easily if the need becomes clear. - I think the recv() method should change before long. The NetReceive() call should be made from the uclass since it is common to all drivers. Then the recv() method can return a packet if it finds one, but not submit it for processing I agree. I never liked how it was laid out and now is a great opportunity to change it since every driver has to be touched anyway. One interesting point for me is that you have taken a slightly more ambitious approach with the conversion by not reusing eth_device. That seems to have have worked out well and makes me think I could revisit SPI flash perhaps and do the same. I agree that it's nicer to get rid of the extra wrapping structure. Naturally the refactor could happen any time, but it seemed simple enough to just do now. All sounds good. Changes in v4: -New to v4 -Fix compile regression in !DM_ETH case -New to v4 -New to v4 -New to v4 -New to v4 -New to v4 If you put this in a patch, patman will remove duplicates in the cover letter. Series-process-log: uniq You can also sort with: Series-process-log: sort, uniq Thanks for the tip. Any reason these are not enabled by default? From memory I think some people didn't want their change logs to be reordered (perhaps because they use more than one line per entry, which I never do). I suppose we could change it and see if anyone sqeals! [snip] Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 16/23] dm: eth: Add support for aliases
Hi Joe, On 1 March 2015 at 15:04, Joe Hershberger joe.hershber...@gmail.com wrote: On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: Allow network devices to be referred to as eth0 instead of eth@12345678 when specified in ethact. Add tests to verify this behavior. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org Again a few comments on error handling for follow-up. --- Changes in v4: -Use only the seq from DM to find aliases Changes in v3: -Added support for aliases Changes in v2: None include/configs/sandbox.h | 2 +- include/net.h | 1 + net/eth.c | 47 ++- test/dm/eth.c | 24 test/dm/test.dts | 4 +++- 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 9189f6a..caf9f5a 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -174,7 +174,7 @@ #define SANDBOX_ETH_SETTINGS ethaddr=00:00:11:22:33:44\0 \ eth1addr=00:00:11:22:33:45\0 \ - eth2addr=00:00:11:22:33:46\0 \ + eth5addr=00:00:11:22:33:46\0 \ ipaddr=1.2.3.4\0 #define CONFIG_EXTRA_ENV_SETTINGS SANDBOX_SERIAL_SETTINGS \ diff --git a/include/net.h b/include/net.h index 508c572..e9cb4a3 100644 --- a/include/net.h +++ b/include/net.h @@ -122,6 +122,7 @@ struct eth_ops { #define eth_get_ops(dev) ((struct eth_ops *)(dev)-driver-ops) struct udevice *eth_get_dev(void); /* get the current device */ +struct udevice *eth_get_dev_by_name(const char *devname); This needs a comment to describe what devname is exactly. I thought it was a device name. OK Also it seems to requite a minimum length of 3 characters? Good point. This is a bug. I should be checking the size first. It is not an intended requirement. unsigned char *eth_get_ethaddr(void); /* get the current device MAC */ /* Used only when NetConsole is enabled */ int eth_init_state_only(void); /* Set active state */ diff --git a/net/eth.c b/net/eth.c index 9c2dfb9..8b853e8 100644 --- a/net/eth.c +++ b/net/eth.c @@ -132,6 +132,36 @@ static void eth_set_dev(struct udevice *dev) eth_get_uclass_priv()-current = dev; } +/* + * Find the udevice that either has the name passed in as devname or has an + * alias named devname. + */ +struct udevice *eth_get_dev_by_name(const char *devname) +{ + int seq; + char *endp = NULL; + const char *startp; + struct udevice *it; + struct uclass *uc; + + startp = devname + strlen(eth); + seq = simple_strtoul(startp, endp, 10); + + uclass_get(UCLASS_ETH, uc); + uclass_foreach_dev(it, uc) { + /* We need the seq to be valid, so make sure it's probed */ + device_probe(it); Error check. I think this function is should return an error. This is simply searching. If a device annot be probed, why error out a search for presumably a different device? I can look into adding a unit test to validate this behavior. Well normal error behaviour is to report the error to the upper layers which may or may not stop. But a failure to probe a device which should be there seems bad. Anyway if you are wanting to not check these errors you should at least add big comments in those places as to why. I'd hate for people not to understand the rationale and just assume that errors don't matter (because they don't understand the special cases here). + /* +* Check for the name or the sequence number to match +*/ + if (strcmp(it-name, devname) == 0 || + (endp startp it-seq == seq)) + return it; + } + + return NULL; +} + unsigned char *eth_get_ethaddr(void) { struct eth_pdata *pdata; @@ -405,6 +435,7 @@ UCLASS_DRIVER(eth) = { .pre_remove = eth_pre_remove, .priv_auto_alloc_size = sizeof(struct eth_uclass_priv), .per_device_auto_alloc_size = sizeof(struct eth_device_priv), + .flags = DM_UC_FLAG_SEQ_ALIAS, }; #endif @@ -437,6 +468,11 @@ static void eth_set_current_to_next(void) eth_current = eth_current-next; } +static void eth_set_dev(struct eth_device *dev) +{ + eth_current = dev; +} + struct eth_device *eth_get_dev_by_name(const char *devname) { struct eth_device *dev, *target_dev; @@ -853,7 +889,6 @@ void eth_set_current(void) {
Re: [U-Boot] [RFC PATCH v4 02/23] common: Make sure arch-specific map_sysmem() is defined
Hi Joe, On 1 March 2015 at 14:16, Joe Hershberger joe.hershber...@gmail.com wrote: Hi Simon, On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: In the case where the arch defines a custom map_sysmem(), make sure that including just common.h is sufficient to have these functions as they are when the arch does not override it. Signed-off-by: Joe Hershberger joe.hershber...@ni.com --- Changes in v4: -New to v4 Changes in v3: None Changes in v2: None include/common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index 77c55c6..6510efc 100644 --- a/include/common.h +++ b/include/common.h @@ -846,7 +846,9 @@ int cpu_release(int nr, int argc, char * const argv[]); #endif /* Define a null map_sysmem() if the architecture doesn't use it */ -# ifndef CONFIG_ARCH_MAP_SYSMEM +# ifdef CONFIG_ARCH_MAP_SYSMEM +#include asm/io.h +# else static inline void *map_sysmem(phys_addr_t paddr, unsigned long len) { return (void *)(uintptr_t)paddr; Do we need this patch? Is it just for sandbox? It would be nice to remove things from common.h rather than adding them! If you have a recommendation for where these static inline functions should move, then I'm happy to move it all to a new place. My assertion is that whatever it is that you include to get these static inlines should also be what you include when CONFIG_ARCH_MAP_SYSMEM is defined. You should not need to include the arch-specific header separately each place that one of these mapping functions is used. Fair enough. I suppose there are two options - requiring all files to include asm/io.h, and putting them in common.h (or some other file). Overall I think I'd prefer that they go in a separate file (perhaps mapmem.h) and include that file everywhere. What do you think? Anyway if you want to go ahead I'm OK with it. Reviewed-by: Simon Glass s...@chromium.org Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] am33xx, spl, siemens: enable debug uart output again
Hello Simon, Am 24.02.2015 14:31, schrieb Simon Glass: Hi Heiko, On 23 February 2015 at 23:18, Heiko Schocher h...@denx.de wrote: a6b541b090: TI ARMv7: Don't use GD before crt0.S has set it moves the init of the debug uart at the very end of SPL code. Enable it for the siemens board earlier, as they print ddr settings ... all debug output before board_init_r() is here currently useless. Maybe we must rework this globally? Assuming we are talking about U-Boot proper, the DDR init should happen in board_init_f(), specifically dram_init(). so I think this code should be updated. If it is SPL, then DDR init should happen in SPL's board_init_f(). It is in SPL... sdram_init() is called from: ./arch/arm/cpu/armv7/am33xx/board.c from s_init() ... I sent a series a few weeks ago (available at u-boot-dm branch spl-working) related to this topic: http://patchwork.ozlabs.org/patch/438581/ Ah ... Hmm... so ./arch/arm/cpu/armv7/am33xx/board.c needs a rework, right? Is a simple rename s_init() - board_init_f() correct? @Tom: Could you help here? bye, Heiko Signed-off-by: Heiko Schocher h...@denx.de --- board/siemens/common/board.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c index cc0ac6b..fb2de48 100644 --- a/board/siemens/common/board.c +++ b/board/siemens/common/board.c @@ -43,6 +43,11 @@ void set_mux_conf_regs(void) /* Initalize the board header */ enable_i2c0_pin_mux(); i2c_set_bus_num(0); + + /* enable early the console */ + gd-baudrate = CONFIG_BAUDRATE; + serial_init(); + gd-have_console = 1; if (read_eeprom() 0) puts(Could not get board ID.\n); -- 2.1.0 Regards, Simon -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v4 23/23] sandbox: eth: Add support for using the 'lo' interface
On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: Hi Joe, On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: The 'lo' interface on Linux doesn't support thinks like ARP or link-layer access like we use to talk to a normal network interface. A higher-level network API must be used to access localhost. As written, this interface is limited to not supporting ICMP since the API doesn't allow the socket to be opened for all IP traffic and be able to receive at the same time. UDP is far more useful to test with, so it was selected over ICMP. Ping won't work, but things like TFTP should work. Signed-off-by: Joe Hershberger joe.hershber...@ni.com --- Changes in v4: -Added support for the 'lo' network interface Changes in v3: None Changes in v2: None arch/sandbox/cpu/eth-raw-os.c | 152 +++--- arch/sandbox/dts/sandbox.dts | 10 +++ arch/sandbox/include/asm/eth-raw-os.h | 10 ++- drivers/net/sandbox-raw.c | 62 +- 4 files changed, 203 insertions(+), 31 deletions(-) diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index 9218f94..acb150a 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -11,6 +11,8 @@ #include errno.h #include net/if.h #include netinet/in.h +#include netinet/ip.h +#include netinet/udp.h #include stdio.h #include stdlib.h #include string.h @@ -19,51 +21,139 @@ #include sys/socket.h #include unistd.h +#include arpa/inet.h #include linux/if_ether.h #include linux/if_packet.h int sandbox_eth_raw_os_init(const char *ifname, unsigned char *ethmac, struct eth_sandbox_raw_priv *priv) { - struct sockaddr_ll *device; - struct packet_mreq mr; - - /* Prepare device struct */ - priv-device = malloc(sizeof(struct sockaddr_ll)); - device = priv-device; - memset(device, 0, sizeof(struct sockaddr_ll)); - device-sll_ifindex = if_nametoindex(ifname); - device-sll_family = AF_PACKET; - memcpy(device-sll_addr, ethmac, 6); - device-sll_halen = htons(6); - - /* Open socket */ - priv-sd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); - if (priv-sd 0) { - printf(Failed to open socket: %d %s\n, errno, - strerror(errno)); - return -errno; + if (priv-local) { Can you put these two blocks of code (if and else) in separate functions and call them from here? This function is too long. OK + struct sockaddr_in *device; + int ret; + struct timeval tv; + int one = 1; + + /* Prepare device struct */ + priv-device = malloc(sizeof(struct sockaddr_in)); return -ENOMEM if NULL. + device = priv-device; + memset(device, 0, sizeof(struct sockaddr_in)); + device-sin_family = AF_INET; + ret = inet_pton(AF_INET, 127.0.0.1, Is this INADDR_LOOPBACK? Maybe you can just assign it here? + (struct in_addr *)device-sin_addr.s_addr); + if (ret 0) { + printf(Failed to convert address: %d %s\n, errno, + strerror(errno)); + return -errno; + } + + /** +* Open socket +* Since we specify UDP here, any incoming ICMP packets will +* not be received, so things like ping will not work on this +* localhost interface. +*/ + priv-sd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); + if (priv-sd 0) { + printf(Failed to open socket: %d %s\n, errno, + strerror(errno)); + return -errno; + } + + /* Allow the receive to timeout after a millisecond */ + tv.tv_sec = 0; + tv.tv_usec = 1000; + ret = setsockopt(priv-sd, SOL_SOCKET, SO_RCVTIMEO, (char *)tv, + sizeof(struct timeval)); + if (ret 0) { + printf(Failed to set opt: %d %s\n, errno, + strerror(errno)); + return -errno; + } + + /* Include the UDP/IP headers on send and receive */ + ret = setsockopt(priv-sd, IPPROTO_IP, IP_HDRINCL, one, +sizeof(one)); + if (ret 0) { + printf(Failed to set opt: %d %s\n, errno, + strerror(errno)); + return
Re: [U-Boot] [RFC PATCH v4 21/23] sandbox: eth: Add a bridge to a real network for sandbox
On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass s...@chromium.org wrote: On 24 February 2015 at 17:02, Joe Hershberger joe.hershber...@ni.com wrote: Implement a bridge between u-boot's network stack and Linux's raw packet API allowing the sandbox to send and receive packets using the host machine's network interface. This raw Ethernet API requires elevated privileges. You can either run as root, or you can add the capability needed like so: sudo /sbin/setcap CAP_NET_RAW+ep u-boot Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org A few nits below. --- Changes in v4: -Added comments to README.sandbox -Use accessors for platdata and priv -Add comments to priv struct definition -Move os file to arch -Cleanup var definition order -Moved config to Kconfig -Clean up the interface to sandbox's eth-raw-os by passing priv to raw-os -Fixed the MAC address limitation (now all traffic uses MAC address from env) Changes in v3: -Made the os raw packet support for sandbox eth build and work. Changes in v2: -Added the raw packet proof-of-concept patch. arch/sandbox/Kconfig | 3 + arch/sandbox/cpu/Makefile | 10 arch/sandbox/cpu/eth-raw-os.c | 102 + arch/sandbox/dts/sandbox.dts | 6 ++ arch/sandbox/include/asm/eth-raw-os.h | 32 +++ board/sandbox/README.sandbox | 13 + drivers/net/Kconfig | 5 ++ drivers/net/Makefile | 1 + drivers/net/sandbox-raw.c | 105 ++ 9 files changed, 277 insertions(+) create mode 100644 arch/sandbox/cpu/eth-raw-os.c create mode 100644 arch/sandbox/include/asm/eth-raw-os.h create mode 100644 drivers/net/sandbox-raw.c diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 186b58d..f84b3fc 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -43,4 +43,7 @@ config NETDEVICES config DM_ETH default y +config ETH_SANDBOX_RAW + default y + endmenu diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile index 7d4410c..1b42fee 100644 --- a/arch/sandbox/cpu/Makefile +++ b/arch/sandbox/cpu/Makefile @@ -8,6 +8,7 @@ # obj-y := cpu.o os.o start.o state.o +obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o obj-$(CONFIG_SANDBOX_SDL) += sdl.o # os.c is build in the system environment, so needs standard includes @@ -20,3 +21,12 @@ $(obj)/os.o: $(src)/os.c FORCE $(call if_changed_dep,cc_os.o) $(obj)/sdl.o: $(src)/sdl.c FORCE $(call if_changed_dep,cc_os.o) + +# eth-raw-os.c is built in the system env, so needs standard includes +# CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path +quiet_cmd_cc_eth-raw-os.o = CC $(quiet_modtag) $@ +cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \ + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ lt; + +$(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE + $(call if_changed_dep,cc_eth-raw-os.o) diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c new file mode 100644 index 000..9218f94 --- /dev/null +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2015 National Instruments + * + * (C) Copyright 2015 + * Joe Hershberger joe.hershber...@ni.com + * + * SPDX-License-Identifier:GPL-2.0 + */ + +#include asm/eth-raw-os.h +#include errno.h +#include net/if.h +#include netinet/in.h +#include stdio.h +#include stdlib.h +#include string.h +#include sys/types.h +#include sys/ioctl.h +#include sys/socket.h +#include unistd.h + +#include linux/if_ether.h +#include linux/if_packet.h + +int sandbox_eth_raw_os_init(const char *ifname, unsigned char *ethmac, + struct eth_sandbox_raw_priv *priv) +{ + struct sockaddr_ll *device; + struct packet_mreq mr; + + /* Prepare device struct */ + priv-device = malloc(sizeof(struct sockaddr_ll)); This calls U-Boot's malloc() and it can return NULL, so you should return -ENOMEM in that case. OK + device = priv-device; + memset(device, 0, sizeof(struct sockaddr_ll)); + device-sll_ifindex = if_nametoindex(ifname); + device-sll_family = AF_PACKET; + memcpy(device-sll_addr, ethmac, 6); + device-sll_halen = htons(6); + + /* Open socket */ + priv-sd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (priv-sd 0) { + printf(Failed to open socket: %d %s\n, errno, + strerror(errno)); + return -errno; + } + /* Bind to the specified interface */ + setsockopt(priv-sd, SOL_SOCKET, SO_BINDTODEVICE, ifname, +
[U-Boot] [PATCH] Armv8: Initializing CNTVOFF_EL2
From: David Feng feng...@phytium.com.cn Linux-arm64 require that CNTVOFF_EL2 should be programmed with a consistent value on all cpus. Initializing CNTVOFF_EL2 at state transition instead of start.S could prevent potential different value on cpus if ATF exist and u-boot runs at only one cpu. Signed-off-by: David Feng feng...@phytium.com.cn --- arch/arm/include/asm/macro.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/include/asm/macro.h b/arch/arm/include/asm/macro.h index 1c8c425..39df86a 100644 --- a/arch/arm/include/asm/macro.h +++ b/arch/arm/include/asm/macro.h @@ -113,6 +113,9 @@ lr .reqx30 mov \xreg1, #0x33ff msr cptr_el2, \xreg1/* Disable coprocessor traps to EL2 */ + /* Initialize Generic Timers */ + msr cntvoff_el2, xzr + /* Initialize SCTLR_EL2 * * setting RES1 bits (29,28,23,22,18,16,11,5,4) to 1 -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm64: Add Xilinx ZynqMP support
On 02/27/2015 06:13 PM, Tom Rini wrote: On Tue, Feb 24, 2015 at 09:02:09AM +0100, Michal Simek wrote: Add basic Xilinx ZynqMP arm64 support. Serial and SD is supported. It supports emulation platfrom ep108 and QEMU. Signed-off-by: Michal Simek michal.si...@xilinx.com [snip] +/* Miscellaneous configurable options */ +#define CONFIG_SYS_LOAD_ADDR0x800 + +/* Initial environment variables */ +#define CONFIG_EXTRA_ENV_SETTINGS \ +ethaddr=00:0a:35:00:01:22\0 \ No, you can't hard-code an ethaddr in. ah yeah. +kernel_addr=0x20\0 \ +initrd_addr=0xa0\0 \ +initrd_size=0x200\0 \ These are really close together. And I imagine mirror the usual values on 32bit platforms. Maybe it's time to move them around a bit for more space? Currently I haven't had any problem with these values but I just don't know what will happen in future. +fdt_addr=0x10\0 \ +fdt_high=0x1000\0 \ We also shouldn't have to play stop relocating the DT games on aarch64, right? Since all memory is visible and that's why we have to do those games on aarch32. Will play with it to confirm it. +sdboot=mmcinfo fatload mmc 0:0 f00 system.dtb \ +fatload mmc 0:0 f00 Image booti 8 - f00\0 You aren't using $fdt_addr/$kernel_addr here and probably should? yes. I have this patch in my repo - will update and send v2. Thanks, Michal signature.asc Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 29/29] rockchip: Add a simple README
Add a few notes on how to try out the Rockchip support so far. Signed-off-by: Simon Glass s...@chromium.org --- doc/README.rockchip | 83 + 1 file changed, 83 insertions(+) create mode 100644 doc/README.rockchip diff --git a/doc/README.rockchip b/doc/README.rockchip new file mode 100644 index 000..2f26814 --- /dev/null +++ b/doc/README.rockchip @@ -0,0 +1,83 @@ +# +# Copyright (C) 2015 Google. Inc +# Written by Simon Glass s...@chromium.org +# +# SPDX-License-Identifier: GPL-2.0+ +# + +U-Boot on Rockchip +== + +There are several repositories available with versions of U-Boot that support +many Rockchip devices [1] [2]. + +The current mainline support is experimental only and is not useful for +anything. It should provide a base on which to build. + + +Prerequisites += + +You will need: + + - Firefly RK3288 baord + - Power connection to 5V using the supplied micro-USB power cable + - Separate USB serial cable attached to your computer and the Firefly +(connect to the micro-USB connector below the logo) + - rkflashtool [3] + - openssl (sudo apt-get install openssl) + - Serial UART connection [4] + - Suitable ARM cross compiler, e.g.: +sudo apt-get install gcc-4.7-arm-linux-gnueabi + + +Building + + +At present, only Firefly RK3288 is supported. You can use the firefly-rk3288 +configuration for this. + + CROSS_COMPILE=arm-linux-gnueabi- make O=firefly firefly-rk3288_defconfig all + +(or you can use another cross compiler if you prefer) + + +Writing to the board + + +Only USB is supported. For this to work you must get your board into ROM +boot mode, either by erasing your MMC or (perhaps) holding the recovery +button when you boot the board. To erase your MMC, you can boot into Linux +and type (as root) 'dd if=/dev/zero of=/dev/mmcblk0 bs=1M'. + +To create a suitable image and write it to the board: + + ./firefly/tools/mkimage -T rockchip -d firefly/spl/u-boot-spl-dtb.bin out + cat out | openssl rc4 -K 7c4e0304550509072d2c7b38170d1711 | rkflashtool l + +If all goes well you should something like: + + U-Boot SPL 2015.04-rc2-00123-gc5b539a-dirty (Feb 27 2015 - 09:35:31) + SPL: Unsupported Boot Device! + ### ERROR ### Please RESET the board ### + +You will need to reset the board before each time you try. Yes, that's all +it does so far. + + +Future work +=== + +Immediate priorities are: + +- Support SPL clock init +- Support loading U-Boot from MMC +- Boot U-Boot to a prompt + +There are plenty of patches in the links below to help with this work. + + +[1] https://github.com/rkchrome/uboot.git +[2] https://github.com/linux-rockchip/u-boot-rockchip.git branch u-boot-rk3288 +[3] https://github.com/linux-rockchip/rkflashtool.git +[4] http://wiki.t-firefly.com/index.php/Firefly-RK3288/Serial_debug/en -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 04/29] serial: ns16550: Remove unnecessary init on UART setup
It is not necessary to write a zero baud rate to the device, and for some chips this will cause problems. Drop this code. Signed-off-by: Simon Glass s...@chromium.org --- drivers/serial/ns16550.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index eddd075..6a3a989 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -182,7 +182,6 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) serial_out(0x7, com_port-mdr1); /* mode select reset TL16C750*/ #endif - NS16550_setbrg(com_port, 0); serial_out(UART_MCRVAL, com_port-mcr); serial_out(UART_FCRVAL, com_port-fcr); if (baud_divisor != -1) -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 25/29] rockchip: Add base SoC files
Add some basic files required to allow the SoC to start up. This is a minimal set, enough only to display a serial message in SPL and hang. Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/Kconfig | 9 ++ arch/arm/Makefile | 1 + arch/arm/include/asm/arch-rockchip/clock.h | 12 ++ arch/arm/include/asm/arch-rockchip/gpio.h | 5 + arch/arm/include/asm/arch-rockchip/grf.h | 181 + arch/arm/mach-rockchip/Kconfig | 44 +++ arch/arm/mach-rockchip/Makefile| 12 ++ arch/arm/mach-rockchip/board-spl.c | 54 + arch/arm/mach-rockchip/board.c | 17 +++ arch/arm/mach-rockchip/common.c| 11 ++ arch/arm/mach-rockchip/rk3288/Kconfig | 6 + 11 files changed, 352 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/clock.h create mode 100644 arch/arm/include/asm/arch-rockchip/gpio.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf.h create mode 100644 arch/arm/mach-rockchip/Kconfig create mode 100644 arch/arm/mach-rockchip/Makefile create mode 100644 arch/arm/mach-rockchip/board-spl.c create mode 100644 arch/arm/mach-rockchip/board.c create mode 100644 arch/arm/mach-rockchip/common.c create mode 100644 arch/arm/mach-rockchip/rk3288/Kconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f0e6dec..1eee2d8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -693,6 +693,13 @@ config ARCH_UNIPHIER select OF_CONTROL select SPL_DISABLE_OF_CONTROL +config ARCH_ROCKCHIP + bool Support Rockchip SoCs + select SUPPORT_SPL + select SPL + select OF_CONTROL + select CPU_V7 + endchoice source arch/arm/mach-at91/Kconfig @@ -721,6 +728,8 @@ source arch/arm/mach-orion5x/Kconfig source arch/arm/cpu/armv7/rmobile/Kconfig +source arch/arm/mach-rockchip/Kconfig + source arch/arm/cpu/armv7/s5pc1xx/Kconfig source arch/arm/mach-tegra/Kconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 878ae26..29945c4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -14,6 +14,7 @@ machine-$(CONFIG_KIRKWOOD)+= kirkwood machine-$(CONFIG_ARCH_NOMADIK) += nomadik # TODO: rename CONFIG_ORION5X - CONFIG_ARCH_ORION5X machine-$(CONFIG_ORION5X) += orion5x +machine-$(CONFIG_ARCH_ROCKCHIP)+= rockchip machine-$(CONFIG_TEGRA)+= tegra machine-$(CONFIG_ARCH_VERSATILE) += versatile diff --git a/arch/arm/include/asm/arch-rockchip/clock.h b/arch/arm/include/asm/arch-rockchip/clock.h new file mode 100644 index 000..9314585 --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/clock.h @@ -0,0 +1,12 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier:GPL-2.0 + */ + +#ifndef _ASM_ARCH_CLOCK_H +#define _ASM_ARCH_CLOCK_H + +#define OSC_HZ (24 * 1000 * 1000) + +#endif diff --git a/arch/arm/include/asm/arch-rockchip/gpio.h b/arch/arm/include/asm/arch-rockchip/gpio.h new file mode 100644 index 000..607949c --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/gpio.h @@ -0,0 +1,5 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ diff --git a/arch/arm/include/asm/arch-rockchip/grf.h b/arch/arm/include/asm/arch-rockchip/grf.h new file mode 100644 index 000..8722a89 --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/grf.h @@ -0,0 +1,181 @@ +/* + * (C) Copyright 2015 Google, Inc + * Copyright 2014 Rockchip Inc. + * + * SPDX-License-Identifier:GPL-2.0 + * + * From coreboot file of the same name + */ + +#ifndef _ASM_ARCH_GRF_H +#define _ASM_ARCH_GRF_H + +struct rk3288_grf_gpio_lh { + u32 l; + u32 h; +}; + +struct rk3288_grf_regs { + u32 reserved[3]; + union { + u32 gpio1d_iomux; + u32 iomux_lcdc; + }; + u32 gpio2a_iomux; + u32 gpio2b_iomux; + union { + u32 gpio2c_iomux; + u32 iomux_i2c3; + }; + u32 reserved2; + union { + u32 gpio3a_iomux; + u32 iomux_emmcdata; + }; + union { + u32 gpio3b_iomux; + u32 iomux_emmcpwren; + }; + union { + u32 gpio3c_iomux; + u32 iomux_emmccmd; + }; + u32 gpio3dl_iomux; + u32 gpio3dh_iomux; + u32 gpio4al_iomux; + u32 gpio4ah_iomux; + u32 gpio4bl_iomux; + u32 reserved3; + u32 gpio4c_iomux; + u32 gpio4d_iomux; + u32 reserved4; + union { + u32 gpio5b_iomux; + u32 iomux_spi0; + }; + u32 gpio5c_iomux; + u32 reserved5; + union { + u32 gpio6a_iomux; + u32 iomux_i2s; + }; + union { + u32 gpio6b_iomux; + u32 iomux_i2c2; + u32 iomux_i2sclk; + }; + union { +
Re: [U-Boot] Writing to MMC(%d)... failed
On Fri, Feb 27, 2015 at 7:16 AM, Przemyslaw Marczak p.marc...@samsung.com wrote: This is too late for debug. The same result I can see when my card is not inserted. Ugh, I meant to include the link to my post in the odroid forums which included the entire (very long) output: http://forum.odroid.com/viewtopic.php?f=13t=2883#p76524 I'll inline compare my lines with yours, and prepend and append '*' to those that differ: You should follow the card init sequence with the trace config, because it fails at init. This is the trace output from init sequence of my SD card: MMC: SAMSUNG SDHCI: 0, EXYNOS DWMMC: 1 MMC: SAMSUNG SDHCI: 0, EXYNOS DWMMC: 1 CMD_SEND:0 CMD_SEND:0 ARG 0x ARG 0x MMC_RSP_NONE MMC_RSP_NONE CMD_SEND:8 CMD_SEND:8 ARG 0x01AA ARG 0x01AA MMC_RSP_R1,5,6,7 0x01AA MMC_RSP_R1,5,6,7 0x01AA CMD_SEND:55 CMD_SEND:55 ARG 0x ARG 0x MMC_RSP_R1,5,6,7 0x0120 MMC_RSP_R1,5,6,7 0x0120 CMD_SEND:41 CMD_SEND:41 ARG 0x4030 ARG 0x4030 MMC_RSP_R3,4 0x40FF8000 MMC_RSP_R3,4 0x40FF8000 CMD_SEND:55 CMD_SEND:55 ARG 0x ARG 0x MMC_RSP_R1,5,6,7 0x0120 MMC_RSP_R1,5,6,7 0x0120 CMD_SEND:41 CMD_SEND:41 ARG 0x4030 ARG 0x4030 MMC_RSP_R3,4 0x40FF8000 * MMC_RSP_R3,4 0xC0FF8000* At the moment, I don't know what that command corresponds with, but I see the 55 and 41 are repeated 1 more time with yours before getting that 41 output that I have. Perhaps it's a timing/retry attempt on your system. CMD_SEND:55 ARG 0x MMC_RSP_R1,5,6,7 0x0120 *retry attempt? Not on mine.* CMD_SEND:41 ARG 0x4030 MMC_RSP_R3,4 0xC0FF8000 *retry attempt? Not on mine.* CMD_SEND:2 CMD_SEND:2 ARG 0x ARG 0x MMC_RSP_R2 0x03534453 MMC_RSP_R2 0x03534453 0x55303447 * 0x55303847 * 0x80273727 * 0x8005FCD3* 0x6900E700 * 0x3000A400* DUMPING DATA DUMPING DATA 000 - 03 53 44 53 000 - 03 53 44 53 004 - 55 30 34 47 * 004 - 55 30 38 47* 008 - 80 27 37 27 * 008 - 80 05 FC D3* 012 - 69 00 E7 00 * 012 - 30 00 A4 00* CMD_SEND:3 CMD_SEND:3 ARG 0x ARG 0x MMC_RSP_R1,5,6,7 0x0520 * MMC_RSP_R1,5,6,7 0xE6240520* CMD_SEND:9 CMD_SEND:9 ARG 0x * ARG 0xE624* MMC_RSP_R2 0x400E0032 MMC_RSP_R2 0x400E0032 0x5B59 0x5B59 0x1D8A7F80 * 0x3B377F80* 0x0A404000 0x0A404000 DUMPING DATA DUMPING DATA 000 - 40 0E 00 32 000 - 40 0E 00 32 004 - 5B 59 00 00 004 - 5B 59 00 00 008 - 1D 8A 7F 80 *
[U-Boot] [PATCH 06/29] dm: core: Allow sequence alias support to be removed for SPL
In many cases SPL only uses a single serial port and there is no need for alias sequence support. We will just use the serial port pointed to by stdout-path in the /chosen node. Signed-off-by: Simon Glass s...@chromium.org --- drivers/core/Kconfig | 9 + drivers/core/device.c | 28 +++- include/config_uncmd_spl.h | 1 + 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 75d182d..2861b43 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -46,3 +46,12 @@ config DM_STDIO Normally serial drivers register with stdio so that they can be used as normal output devices. In SPL we don't normally use stdio, so we can omit this feature. + +config DM_SEQ_ALIAS + bool Support numbered aliases in device tree + depends on DM + default y + help + Most boards will have a '/aliases' node containing the path to + numbered devices (e.g. serial0 = serial0). This feature can be + disabled if it is not required, to save code space in SPL. diff --git a/drivers/core/device.c b/drivers/core/device.c index 73c3e07..78c9525 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -55,21 +55,23 @@ int device_bind(struct udevice *parent, struct driver *drv, const char *name, dev-seq = -1; dev-req_seq = -1; -#ifdef CONFIG_OF_CONTROL - /* -* Some devices, such as a SPI bus, I2C bus and serial ports are -* numbered using aliases. -* -* This is just a 'requested' sequence, and will be -* resolved (and -seq updated) when the device is probed. -*/ - if (uc-uc_drv-flags DM_UC_FLAG_SEQ_ALIAS) { - if (uc-uc_drv-name of_offset != -1) { - fdtdec_get_alias_seq(gd-fdt_blob, uc-uc_drv-name, -of_offset, dev-req_seq); + if (IS_ENABLED(CONFIG_OF_CONTROL) IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) { + /* + * Some devices, such as a SPI bus, I2C bus and serial ports + * are numbered using aliases. + * + * This is just a 'requested' sequence, and will be + * resolved (and -seq updated) when the device is probed. + */ + if (uc-uc_drv-flags DM_UC_FLAG_SEQ_ALIAS) { + if (uc-uc_drv-name of_offset != -1) { + fdtdec_get_alias_seq(gd-fdt_blob, + uc-uc_drv-name, of_offset, + dev-req_seq); + } } } -#endif + if (!dev-platdata drv-platdata_auto_alloc_size) { dev-flags |= DM_FLAG_ALLOC_PDATA; dev-platdata = calloc(1, drv-platdata_auto_alloc_size); diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index a9106f4..38cb0e8 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -31,6 +31,7 @@ #undef CONFIG_DM_WARN #undef CONFIG_DM_DEVICE_REMOVE +#undef CONFIG_DM_SEQ_ALIAS #undef CONFIG_DM_STDIO #endif /* CONFIG_SPL_BUILD */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 02/29] dm: ns16550: Support non-byte register spacing with driver model
Allow this driver to support boards where the register shift is not 0. This fixes some compiler warnings which appear in that case. Signed-off-by: Simon Glass s...@chromium.org --- drivers/serial/ns16550.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 54f432f..cfa91e2 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -56,7 +56,7 @@ DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_DM_SERIAL -static inline void serial_out_shift(unsigned char *addr, int shift, int value) +static inline void serial_out_shift(void *addr, int shift, int value) { #ifdef CONFIG_SYS_NS16550_PORT_MAPPED outb(value, (ulong)addr); @@ -71,7 +71,7 @@ static inline void serial_out_shift(unsigned char *addr, int shift, int value) #endif } -static inline int serial_in_shift(unsigned char *addr, int shift) +static inline int serial_in_shift(void *addr, int shift) { #ifdef CONFIG_SYS_NS16550_PORT_MAPPED return inb((ulong)addr); @@ -113,9 +113,11 @@ static int ns16550_readb(NS16550_t port, int offset) /* We can clean these up once everything is moved to driver model */ #define serial_out(value, addr)\ - ns16550_writeb(com_port, addr - (unsigned char *)com_port, value) + ns16550_writeb(com_port, \ + (unsigned char *)addr - (unsigned char *)com_port, value) #define serial_in(addr) \ - ns16550_readb(com_port, addr - (unsigned char *)com_port) + ns16550_readb(com_port, \ + (unsigned char *)addr - (unsigned char *)com_port) #endif static inline int calc_divisor(NS16550_t port, int clock, int baudrate) -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 27/29] mkimage: Display a better list of available image types
Offer to display the available image types in help. Also, rather than hacking the genimg_get_type_id() function to display a list of types, do this in the tool. Also, sort the list. The list of image types is quite long, and hard to discover. Print it out when we show help information. Signed-off-by: Simon Glass s...@chromium.org --- common/image.c | 54 +--- include/image.h | 11 +++ tools/mkimage.c | 59 ++--- 3 files changed, 93 insertions(+), 31 deletions(-) diff --git a/common/image.c b/common/image.c index a911aa9..7faa91a 100644 --- a/common/image.c +++ b/common/image.c @@ -541,6 +541,15 @@ void genimg_print_time(time_t timestamp) } #endif +const table_entry_t *get_table_entry(const table_entry_t *table, int id) +{ + for (; table-id = 0; ++table) { + if (table-id == id) + return table; + } + return NULL; +} + /** * get_table_entry_name - translate entry id to long name * @table: pointer to a translation table for entries of a specific type @@ -557,15 +566,14 @@ void genimg_print_time(time_t timestamp) */ char *get_table_entry_name(const table_entry_t *table, char *msg, int id) { - for (; table-id = 0; ++table) { - if (table-id == id) + table = get_table_entry(table, id); + if (!table) + return msg; #if defined(USE_HOSTCC) || !defined(CONFIG_NEEDS_MANUAL_RELOC) - return table-lname; + return table-lname; #else - return table-lname + gd-reloc_off; + return table-lname + gd-reloc_off; #endif - } - return (msg); } const char *genimg_get_os_name(uint8_t os) @@ -584,6 +592,20 @@ const char *genimg_get_type_name(uint8_t type) return (get_table_entry_name(uimage_type, Unknown Image, type)); } +const char *genimg_get_type_short_name(uint8_t type) +{ + const table_entry_t *table; + + table = get_table_entry(uimage_type, type); + if (!table) + return unknown; +#if defined(USE_HOSTCC) || !defined(CONFIG_NEEDS_MANUAL_RELOC) + return table-sname; +#else + return table-sname + gd-reloc_off; +#endif +} + const char *genimg_get_comp_name(uint8_t comp) { return (get_table_entry_name(uimage_comp, Unknown Compression, @@ -608,23 +630,7 @@ int get_table_entry_id(const table_entry_t *table, const char *table_name, const char *name) { const table_entry_t *t; -#ifdef USE_HOSTCC - int first = 1; - - for (t = table; t-id = 0; ++t) { - if (t-sname strcasecmp(t-sname, name) == 0) - return(t-id); - } - fprintf(stderr, \nInvalid %s Type - valid names are, table_name); - for (t = table; t-id = 0; ++t) { - if (t-sname == NULL) - continue; - fprintf(stderr, %c %s, (first) ? ':' : ',', t-sname); - first = 0; - } - fprintf(stderr, \n); -#else for (t = table; t-id = 0; ++t) { #ifdef CONFIG_NEEDS_MANUAL_RELOC if (t-sname strcmp(t-sname + gd-reloc_off, name) == 0) @@ -634,8 +640,8 @@ int get_table_entry_id(const table_entry_t *table, return (t-id); } debug(Invalid %s Type: %s\n, table_name, name); -#endif /* USE_HOSTCC */ - return (-1); + + return -1; } int genimg_get_os_id(const char *name) diff --git a/include/image.h b/include/image.h index 0e6af00..da17a6b 100644 --- a/include/image.h +++ b/include/image.h @@ -243,6 +243,8 @@ struct lmb; #define IH_TYPE_SOCFPGAIMAGE 19 /* Altera SOCFPGA Preloader */ #define IH_TYPE_X86_SETUP 20 /* x86 setup.bin Image */ +#define IH_TYPE_COUNT 21 /* Number of image types */ + /* * Compression Types */ @@ -408,6 +410,15 @@ char *get_table_entry_name(const table_entry_t *table, char *msg, int id); const char *genimg_get_os_name(uint8_t os); const char *genimg_get_arch_name(uint8_t arch); const char *genimg_get_type_name(uint8_t type); + +/** + * genimg_get_type_short_name() - get the short name for an image type + * + * @param type Image type (IH_TYPE_...) + * @return image short name, or unknown if unknown + */ +const char *genimg_get_type_short_name(uint8_t type); + const char *genimg_get_comp_name(uint8_t comp); int genimg_get_os_id(const char *name); int genimg_get_arch_id(const char *name); diff --git a/tools/mkimage.c b/tools/mkimage.c index 5ccd951..8808d70 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -26,8 +26,48 @@ struct image_tool_params params = { .imagename2 = , }; -int -main (int argc, char **argv) +static int h_compare_image_name(const void *vtype1, const void *vtype2) +{ + const int *type1 = vtype1; + const int *type2 = vtype2; + const char *name1 =
[U-Boot] [PATCH 08/29] dm: Add a panic_str() function to reduce code size
The printf() in panic() adds about 1.5KB of code size to SPL when compiled with Thumb-2. Provide a smaller version that does not support printf()-style arguments and use it in two commonly compiled places. Signed-off-by: Simon Glass s...@chromium.org --- drivers/serial/serial-uclass.c | 2 +- include/vsprintf.h | 23 +++ lib/fdtdec.c | 8 +--- lib/vsprintf.c | 23 ++- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 3fc7104..13ba606 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -72,7 +72,7 @@ static void serial_find_console_or_panic(void) if (uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, dev) uclass_get_device(UCLASS_SERIAL, INDEX, dev) (uclass_first_device(UCLASS_SERIAL, dev) || !dev)) - panic(No serial driver found); + panic_str(No serial driver found); #undef INDEX gd-cur_serial_dev = dev; } diff --git a/include/vsprintf.h b/include/vsprintf.h index 5624482..09c8abd 100644 --- a/include/vsprintf.h +++ b/include/vsprintf.h @@ -39,10 +39,33 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res); unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base); long simple_strtol(const char *cp, char **endp, unsigned int base); + +/** + * panic() - Print a message and reset/hang + * + * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is + * defined, then it will hang instead of reseting. + * + * @param fmt: printf() format string for message, which should not include + * \n, followed by arguments + */ void panic(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn)); /** + * panic_str() - Print a message and reset/hang + * + * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is + * defined, then it will hang instead of reseting. + * + * This function can be used instead of panic() when your board does not + * already use printf(), * to keep code size small. + * + * @param fmt: string to display, which should not include \n + */ +void panic_str(const char *str) __attribute__ ((noreturn)); + +/** * Format a string and place it in a buffer * * @param buf The buffer to place the result into diff --git a/lib/fdtdec.c b/lib/fdtdec.c index dd58bbb..cc5ba20 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -564,9 +564,11 @@ int fdtdec_prepare_fdt(void) { if (!gd-fdt_blob || ((uintptr_t)gd-fdt_blob 3) || fdt_check_header(gd-fdt_blob)) { - printf(No valid FDT found - please append one to U-Boot - binary, use u-boot-dtb.bin or define - CONFIG_OF_EMBED. For sandbox, use -d file.dtb\n); +#ifdef CONFIG_SPL_BUILD + puts(Missing DTB\n); +#else + puts(No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d file.dtb\n); +#endif return -1; } return 0; diff --git a/lib/vsprintf.c b/lib/vsprintf.c index e0f2648..bedc865 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -842,13 +842,11 @@ int sprintf(char *buf, const char *fmt, ...) return i; } -void panic(const char *fmt, ...) +static void panic_finish(void) __attribute__ ((noreturn)); + +static void panic_finish(void) { - va_list args; - va_start(args, fmt); - vprintf(fmt, args); putc('\n'); - va_end(args); #if defined(CONFIG_PANIC_HANG) hang(); #else @@ -859,6 +857,21 @@ void panic(const char *fmt, ...) ; } +void panic_str(const char *str) +{ + puts(str); + panic_finish(); +} + +void panic(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vprintf(fmt, args); + va_end(args); + panic_finish(); +} + void __assert_fail(const char *assertion, const char *file, unsigned line, const char *function) { -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/29] Correct malloc_limit value for pre-relocation malloc()
The limit is measured from the start of the malloc() area and is not an absolute address. Correct this. Signed-off-by: Simon Glass s...@chromium.org --- This bug has been there for a while but was not causing problems. I have been meaning to send a patch for a while. common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index cd75bbc..c655332 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -146,7 +146,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) CONFIG_SYS_SPL_MALLOC_SIZE); gd-flags |= GD_FLG_FULL_MALLOC_INIT; #elif defined(CONFIG_SYS_MALLOC_F_LEN) - gd-malloc_limit = gd-malloc_base + CONFIG_SYS_MALLOC_F_LEN; + gd-malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd-malloc_ptr = 0; #endif #ifdef CONFIG_SPL_DM -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 09/29] dm: core: Drop device removal error path when not supported
When CONFIG_DM_DEVICE_REMOVE is not enabled, such as in SPL, we cannot remove or unbind devices and do not expect to get errors when binding and probing devices. So drop the error path to reduce code size. Signed-off-by: Simon Glass s...@chromium.org --- drivers/core/device.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 78c9525..37dc882 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -124,21 +124,27 @@ int device_bind(struct udevice *parent, struct driver *drv, const char *name, return 0; fail_child_post_bind: - if (drv-unbind drv-unbind(dev)) { - dm_warn(unbind() method failed on dev '%s' on error path\n, - dev-name); + if (IS_ENABLED(DM_DEVICE_REMOVE)) { + if (drv-unbind drv-unbind(dev)) { + dm_warn(unbind() method failed on dev '%s' on error path\n, + dev-name); + } } fail_bind: - if (uclass_unbind_device(dev)) { - dm_warn(Failed to unbind dev '%s' on error path\n, - dev-name); + if (IS_ENABLED(DM_DEVICE_REMOVE)) { + if (uclass_unbind_device(dev)) { + dm_warn(Failed to unbind dev '%s' on error path\n, + dev-name); + } } fail_uclass_bind: - list_del(dev-sibling_node); - if (dev-flags DM_FLAG_ALLOC_PARENT_PDATA) { - free(dev-parent_platdata); - dev-parent_platdata = NULL; + if (IS_ENABLED(DM_DEVICE_REMOVE)) { + list_del(dev-sibling_node); + if (dev-flags DM_FLAG_ALLOC_PARENT_PDATA) { + free(dev-parent_platdata); + dev-parent_platdata = NULL; + } } fail_alloc2: if (dev-flags DM_FLAG_ALLOC_PDATA) { -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
Hi Przemyslaw, On Fri, Feb 27, 2015 at 12:35 PM, Przemyslaw Marczak p.marc...@samsung.com wrote: Yes, please update line 33 in your config file, at least with this #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) + CONFIG_SYS_DFU_DATA_BUF_SIZE You don't have enough malloc memory reserved. This fixes the problem :-) Thanks a lot for your help! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/29] dm: Introduce device tree support in SPL (for Rockchip)
With driver model SPL support in place the remaining driver difference between U-Boot proper and SPL is that SPL does not support device tree. This series adds this support, using a Rockchip board as an example. One problem with device tree is that U-Boot has no way of dropping features it does not need or use. For SPL this problem needs to be solved and this series uses the preprocessor for this. The 45KB Firefly device tree reduces to 693 bytes when unused material is removed. A better solution might involve the 'fdtgrep' tool but this has not made it into the device tree compiler as yet. This series includes some changes aimed at reduce code size in SPL, including: - dropping alias sequence support (the aliases node) since many boards just use a single UART in SPL - adding a smaller panic() function that does not support printf()-format strings - removing device unbind code which will never be used in SPL Overall the resulting SPL binary is 8829 bytes with my Linaro 4.8.2 compiler, including the device tree, using Thumb-2. Of this: 1768 bytes is driver model core code 1556 bytes is device tree code 693 bytes is the device tree itself 4756 is other code, including serial drivers, rodata and data The last figure includes rodata incorrectly added by the tool chain [1]. With a bug-fixed gcc 4.9.2 the total size is 6893 bytes including device tree. Approximately 750 bytes is used for strings and driver data (root device and serial) associated with driver model and device tree. This adds up an overhead of around 4750 bytes for driver model and device tree, including the code, rodata and device tree itself. It should therefore be possible to use driver model and device tree in SPL for board that have enough SRAM. Clearly 4KB is impossible without further work (perhaps removing some error strings). I suspect 8KB would be tricky, allowing only 3KB for stack and other code. But 16KB should work OK. SRAM sizes for recent SoCs I am aware of are: Rockchip RK3288: 96KB Tegra 124: 128KB Samsung Exynos 5420: 384KB The Rockchip Firefly was chosen for this work since it is a fairly recent board and is readily available. Rockchip engineers have been actively upstreaming code to Linux in the past year and there is a very full-featured U-Boot available. But it is invisible to most U-Boot people - mainline Rockchip support seems well overdue. This series does not make a serious start on that, since it only prints a message in SPL and then hangs, but additional work should get it booting to a prompt. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303 Simon Glass (29): serial: ns16550: Add an option to specify the debug UART register shift dm: ns16550: Support non-byte register spacing with driver model dm: ns16550: Support CONFIG_SYS_NS16550_MEM32 with driver model serial: ns16550: Remove unnecessary init on UART setup fdt: arm: Drop device tree padding dm: core: Allow sequence alias support to be removed for SPL dm: core: Remove unbind operations when not required dm: Add a panic_str() function to reduce code size dm: core: Drop device removal error path when not supported fdt: sandbox: Move setup code from board_f to fdtdec fdt: Rename setup_fdt() and make it prepare also Move initf_malloc() to a common place Correct malloc_limit value for pre-relocation malloc() fdt: Add an option to disable device tree in SPL dts: Disable device tree for SPL on all boards fdt: Allow FDT functions to be built for SPL dm: core: Select device tree control correctly for SPL dm: Init device tree as well as driver model in SPL dm: serial: Don't support CONFIG_CONS_INDEX with device tree Remove SPL undefine of CONFIG_OF_CONTROL fdt: arm: Build device tree in SPL dm: rockchip: Add serial support rockchip: Bring in RK3288 device tree file includes and bindings rockchip: dts: Adjust device tree files for U-Boot SPL rockchip: Add base SoC files rockchip: Add basic support for firefly-rk3288 mkimage: Display a better list of available image types rockchip: Add the beginnings of an image tool rockchip: Add a simple README arch/arm/Kconfig | 11 + arch/arm/Makefile |1 + arch/arm/cpu/armv7/exynos/Kconfig |8 + arch/arm/cpu/armv7/s5pc1xx/Kconfig |2 + arch/arm/cpu/u-boot-spl.lds|2 +- arch/arm/dts/Makefile |6 +- arch/arm/dts/rk3288-firefly.dts| 82 ++ arch/arm/dts/rk3288-firefly.dtsi | 496 +++ arch/arm/dts/rk3288-thermal.dtsi | 90 ++ arch/arm/dts/rk3288.dtsi | 1480 arch/arm/include/asm/arch-rockchip/clock.h | 12 + arch/arm/include/asm/arch-rockchip/gpio.h |5 + arch/arm/include/asm/arch-rockchip/grf.h | 181 +++
[U-Boot] [PATCH 24/29] rockchip: dts: Adjust device tree files for U-Boot SPL
The 'fdtgrep' tool would probably provide a better solution here, but for now we can use the C preprocessor to remove the parts of the device tree which are not needed in SPL. Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/dts/rk3288.dtsi | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/dts/rk3288.dtsi b/arch/arm/dts/rk3288.dtsi index 8251441..8386bb2 100644 --- a/arch/arm/dts/rk3288.dtsi +++ b/arch/arm/dts/rk3288.dtsi @@ -22,8 +22,11 @@ / { compatible = rockchip,rk3288; +#ifndef CONFIG_SPL_BUILD interrupt-parent = gic; +#endif aliases { +#ifndef CONFIG_SPL_BUILD i2c0 = i2c0; i2c1 = i2c1; i2c2 = i2c2; @@ -38,16 +41,22 @@ mshc1 = sdmmc; mshc2 = sdio0; mshc3 = sdio1; +#endif +#ifndef CONFIG_SPL_BUILD serial0 = uart0; serial1 = uart1; +#endif serial2 = uart2; +#ifndef CONFIG_SPL_BUILD serial3 = uart3; serial4 = uart4; spi0 = spi0; spi1 = spi1; spi2 = spi2; +#endif }; +#ifndef CONFIG_SPL_BUILD cpus { #address-cells = 1; #size-cells = 0; @@ -342,6 +351,7 @@ pinctrl-0 = uart1_xfer; status = disabled; }; +#endif uart2: serial@ff69 { compatible = rockchip,rk3288-uart, snps,dw-apb-uart; @@ -349,12 +359,15 @@ interrupts = GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH; reg-shift = 2; reg-io-width = 4; +#ifndef CONFIG_SPL_BUILD clocks = cru SCLK_UART2, cru PCLK_UART2; clock-names = baudclk, apb_pclk; pinctrl-names = default; pinctrl-0 = uart2_xfer; +#endif status = disabled; }; +#ifndef CONFIG_SPL_BUILD uart3: serial@ff1b { compatible = rockchip,rk3288-uart, snps,dw-apb-uart; reg = 0xff1b 0x100; @@ -1463,4 +1476,5 @@ cru HCLK_VCODEC; }; }; +#endif }; -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 17/29] dm: core: Select device tree control correctly for SPL
Some boards will not use device tree for SPL even with driver model. Add the logic to support this. Signed-off-by: Simon Glass s...@chromium.org --- drivers/core/root.c | 14 -- include/fdtdec.h| 10 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/core/root.c b/drivers/core/root.c index 9b5c6bb..12d0460 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -197,13 +197,15 @@ int dm_init_and_scan(bool pre_reloc_only) debug(dm_scan_platdata() failed: %d\n, ret); return ret; } -#ifdef CONFIG_OF_CONTROL - ret = dm_scan_fdt(gd-fdt_blob, pre_reloc_only); - if (ret) { - debug(dm_scan_fdt() failed: %d\n, ret); - return ret; + + if (OF_CONTROL) { + ret = dm_scan_fdt(gd-fdt_blob, pre_reloc_only); + if (ret) { + debug(dm_scan_fdt() failed: %d\n, ret); + return ret; + } } -#endif + ret = dm_scan_other(pre_reloc_only); if (ret) return ret; diff --git a/include/fdtdec.h b/include/fdtdec.h index a49a184..489e8a6 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -41,6 +41,16 @@ struct fdt_memory { fdt_addr_t end; }; +#ifdef CONFIG_OF_CONTROL +# if defined(CONFIG_SPL_BUILD) defined(SPL_DISABLE_OF_CONTROL) +# define OF_CONTROL 0 +# else +# define OF_CONTROL 1 +# endif +#else +# define OF_CONTROL 0 +#endif + /* * Information about a resource. start is the first address of the resource * and end is the last address (inclusive). The length of the resource will -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 21/29] fdt: arm: Build device tree in SPL
For SPL we want to support building device tree files. Due to limited memory some boards will include only a subset of the full device tree file. So build these files separately for SPL. SPL does not relocate itself so we cannot use the BSS space for the device tree. Instead we place it at the end of BSS and provide a 'pad' file to overlay on the BSS space. So far, CONFIG_OF_EMBED is not supported for SPL. There does not seem to be any reason for it other than debugging. Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/cpu/u-boot-spl.lds | 2 +- arch/arm/dts/Makefile | 2 +- dts/Makefile| 9 ++--- scripts/Makefile.lib| 12 scripts/Makefile.spl| 35 +++ 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds index a8be204..4b6e0f6 100644 --- a/arch/arm/cpu/u-boot-spl.lds +++ b/arch/arm/cpu/u-boot-spl.lds @@ -66,7 +66,7 @@ SECTIONS . = ALIGN(4); __bss_end = .; } - + __bss_size = __bss_end - __bss_start; .dynsym _image_binary_end : { *(.dynsym) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 121725e..6b9d8ea 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -56,7 +56,7 @@ targets += $(dtb-y) DTC_FLAGS += -R 4 PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) +dtbs: $(addprefix $(DTB_PATH)$(obj)/, $(dtb-y)) @: clean-files := *.dtb diff --git a/dts/Makefile b/dts/Makefile index d3122aa..f8f06f0 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -6,6 +6,7 @@ # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is # enabled. See doc/README.fdt-control for more details. +# DTB_PATH is empty for U-Boot proper, and spl/ for SPL DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:%=%) ifeq ($(DEVICE_TREE),) @@ -13,11 +14,13 @@ DEVICE_TREE := unset endif ifneq ($(EXT_DTB),) -DTB := $(EXT_DTB) +BASE_DTB := $(EXT_DTB) else -DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb +BASE_DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb endif +DTB:= $(DTB_PATH)$(BASE_DTB) + $(obj)/dt.dtb: $(DTB) FORCE $(call if_changed,shipped) @@ -33,7 +36,7 @@ $(DTB): arch-dtbs /bin/false) arch-dtbs: - $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs + $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts DTB_PATH=$(DTB_PATH) dtbs .SECONDARY: $(obj)/dt.dtb.S diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 13af604..04d9b50 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -150,11 +150,11 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \ ld_flags = $(LDFLAGS) $(ldflags-y) -# Modified for U-Boot +# Modified for U-Boot, include KBUILD_CPPFLAGS for CONFIG_SPL/TPL_BUILD dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc\ -I$(srctree)/arch/$(ARCH)/dts \ -I$(srctree)/arch/$(ARCH)/dts/include \ --undef -D__DTS__ +-undef -D__DTS__ $(KBUILD_CPPFLAGS) # Finds the multi-part object the current object will be linked into modname-multi = $(sort $(foreach m,$(multi-used),\ @@ -272,15 +272,19 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd,dt_S_dtb) +# Can we remove the duplication here? +quiet_cmd_dtcspl = DTC SPL $@ +# Modified for U-Boot quiet_cmd_dtc = DTC $@ # Modified for U-Boot -cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $ ; \ +cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $ ; \ dtc -O dtb -o $@ -b 0 \ -i $(dir $) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp $(depfile) -$(obj)/%.dtb: $(src)/%.dts FORCE +$(obj)/%.dtb spl/$(obj)/%.dtb tpl/$(obj)/%.dtb: $(src)/%.dts FORCE + $(Q)mkdir -p $(dir $@) $(call if_changed_dep,dtc) dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index ea67137..def962c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -31,10 +31,14 @@ endif ifeq ($(CONFIG_TPL_BUILD),y) SPL_BIN := u-boot-tpl +DTB_PATH := tpl/ else SPL_BIN := u-boot-spl +DTB_PATH := spl/ endif +export DTB_PATH + include $(srctree)/config.mk include $(srctree)/arch/$(ARCH)/Makefile @@ -50,6 +54,7 @@ HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makef libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/) libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ +libs-$(CONFIG_OF_EMBED) += dts/ libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/ libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ @@ -151,6 +156,8 @@ boot.bin: $(obj)/u-boot-spl.bin ALL-y +=
[U-Boot] [PATCH 12/29] Move initf_malloc() to a common place
To allow this function to be used from SPL, move it to the malloc() code. Signed-off-by: Simon Glass s...@chromium.org --- common/board_f.c | 12 +--- common/dlmalloc.c | 11 +++ include/malloc.h | 3 +++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index eab0050..82b8a66 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -23,6 +23,7 @@ #include i2c.h #include initcall.h #include logbuff.h +#include malloc.h /* TODO: Can we move these into arch/ headers? */ #ifdef CONFIG_8xx @@ -692,17 +693,6 @@ static int mark_bootstage(void) return 0; } -static int initf_malloc(void) -{ -#ifdef CONFIG_SYS_MALLOC_F_LEN - assert(gd-malloc_base);/* Set up by crt0.S */ - gd-malloc_limit = gd-malloc_base + CONFIG_SYS_MALLOC_F_LEN; - gd-malloc_ptr = 0; -#endif - - return 0; -} - static int initf_dm(void) { #if defined(CONFIG_DM) defined(CONFIG_SYS_MALLOC_F_LEN) diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 6453ee9..741215b 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -3257,6 +3257,17 @@ int mALLOPt(param_number, value) int param_number; int value; } } +int initf_malloc(void) +{ +#ifdef CONFIG_SYS_MALLOC_F_LEN + assert(gd-malloc_base);/* Set up by crt0.S */ + gd-malloc_limit = CONFIG_SYS_MALLOC_F_LEN; + gd-malloc_ptr = 0; +#endif + + return 0; +} + /* History: diff --git a/include/malloc.h b/include/malloc.h index 5df6348..f4da9e6 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -906,6 +906,9 @@ void *realloc_simple(void *ptr, size_t size); #endif +/* Set up pre-relocation malloc() ready for use */ +int initf_malloc(void); + /* Public routines */ /* Simple versions which can be used when space is tight */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/9] ARM: tegra: pinmux: Tegra210 support
Hi Stephen, On 25 February 2015 at 20:44, Stephen Warren swar...@wwwdotorg.org wrote: On 02/25/2015 05:54 PM, Simon Glass wrote: On 24 February 2015 at 17:06, Stephen Warren swar...@wwwdotorg.org wrote: On 02/24/2015 04:44 PM, Simon Glass wrote: On 24 February 2015 at 14:08, Stephen Warren swar...@wwwdotorg.org wrote: This series performs a few small cleanups to or parameterizations of the existing Tegra pinmux driver, and adds Tegra210 support. The Tegra210 code isn't actually used yet, since the balance of the Tegra210 support is not yet present. However, it should start appearing soon. ... Stephen Warren (9): ARM: tegra: pinmux: add note re: drive group field defines ARM: tegra: pinmux: simplify some defines ARM: tegra: pinmux: handle feature removal on newer SoCs ARM: tegra: pinmux: move some type definitions ARM: tegra: pinmux: partially handle varying register layouts ARM: tegra: pinmux: support hsm/schmitt on pins ARM: tegra: pinmux: account for different drivegroup base registers ARM: tegra: pinmux: support Tegra210's e_io_hv pin option ARM: tegra: pinmux: add Tegra210 support Does the Linux side look similar to this? The use of #defines seem like a potential temporary solution but I hope it doesn't stay that way. ... The Linux side was already a bit more parameterized, so the Tegra210 support series doesn't have as many patches as the U-Boot series. However, that comes at the cost of the per-SoC drivers having much larger data tables, so I don't expect we'd want to adopt in U-Boot the same level of driver parameterization as Linux. I see - do you know how much bigger the tables are? Kernel per-SoC files: textdata bss dec hex filename 255321068 0 2660067e8 pinctrl-tegra30.o 187441032 0 197764d40 pinctrl-tegra114.o 198681128 0 209965204 pinctrl-tegra124.o 16296 972 0 172684374 pinctrl-tegra210.o U-Boot per-SoC files, although these could actually be reduced to zero if we re-wrote the per-board pinmux tables to use FUNC0..3 enums (i.e. raw HW register mux values) and hence got rid of the need to map a mux enum to FUNC0..3 values. Auto-generation of the per-board files would make pretty easy, if all boards were in tegra-pinmux-scripts. textdata bss dec hex filename 996 4 01000 3e8 .../tegra30/pinmux.o 1036 4 01040 410 .../tegra114/pinmux.o 1076 4 01080 438 .../tegra124/pinmux.o Wow that's pretty compelling! I suppose removing the #ifdefs wouldn't bloat it that much, but it sounds like we should stick with what you have. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 26/29] rockchip: Add basic support for firefly-rk3288
The Firefly RK3288 is a suitable target board for initial mainline Rockchip support. It includes a good set of peripherals, a recent SoC and it is readily available. This adds only some basic files required to allow the baord to display a serial message in SPL and hang. Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/dts/Makefile | 2 + arch/arm/dts/rk3288-firefly.dts | 82 + arch/arm/dts/rk3288-firefly.dtsi | 496 ++ arch/arm/mach-rockchip/rk3288/Kconfig | 10 + board/firefly/firefly-rk3288/Kconfig | 15 + board/firefly/firefly-rk3288/MAINTAINERS | 6 + board/firefly/firefly-rk3288/Makefile | 7 + board/firefly/firefly-rk3288/firefly-rk3288.c | 7 + configs/firefly-rk3288_defconfig | 11 + include/configs/firefly-rk3288.h | 50 +++ 10 files changed, 686 insertions(+) create mode 100644 arch/arm/dts/rk3288-firefly.dts create mode 100644 arch/arm/dts/rk3288-firefly.dtsi create mode 100644 board/firefly/firefly-rk3288/Kconfig create mode 100644 board/firefly/firefly-rk3288/MAINTAINERS create mode 100644 board/firefly/firefly-rk3288/Makefile create mode 100644 board/firefly/firefly-rk3288/firefly-rk3288.c create mode 100644 configs/firefly-rk3288_defconfig create mode 100644 include/configs/firefly-rk3288.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 6b9d8ea..234254f 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -15,6 +15,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5420-peach-pit.dtb \ exynos5800-peach-pi.dtb \ exynos5422-odroidxu3.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += \ + rk3288-firefly.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/rk3288-firefly.dts b/arch/arm/dts/rk3288-firefly.dts new file mode 100644 index 000..f18bccf --- /dev/null +++ b/arch/arm/dts/rk3288-firefly.dts @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014, 2015 FUKAUMI Naoki nao...@gmail.com + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the Software), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include rk3288-firefly.dtsi + +/ { + model = Firefly-RK3288; + compatible = firefly,firefly-rk3288, rockchip,rk3288; + + chosen { +stdout-path = uart2; +}; +}; + +#ifndef CONFIG_SPL_BUILD +ir { + gpios = gpio7 0 GPIO_ACTIVE_LOW; +}; + +pinctrl { + act8846 { + pmic_vsel: pmic-vsel { + rockchip,pins = 7 14 RK_FUNC_GPIO pcfg_output_low; + }; + }; + + ir { + ir_int: ir-int { + rockchip,pins = 7 0 RK_FUNC_GPIO pcfg_pull_up; + }; + }; +}; + +pwm1 { + status = okay; +}; + +uart2 { + u-boot,dm-pre-reloc; +}; + +#endif diff --git a/arch/arm/dts/rk3288-firefly.dtsi b/arch/arm/dts/rk3288-firefly.dtsi new file mode 100644 index 000..d65fbb9 --- /dev/null +++ b/arch/arm/dts/rk3288-firefly.dtsi @@
[U-Boot] [PATCH 15/29] dts: Disable device tree for SPL on all boards
We plan to enable device tree in SPL by default. Before doing this, explicitly disable it for all boards. Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/Kconfig | 2 ++ arch/arm/cpu/armv7/exynos/Kconfig | 8 arch/arm/cpu/armv7/s5pc1xx/Kconfig| 2 ++ arch/arm/mach-tegra/Kconfig | 3 +++ configs/Linksprite_pcDuino3_fdt_defconfig | 1 + configs/am335x_boneblack_vboot_defconfig | 1 + configs/arches_defconfig | 1 + configs/canyonlands_defconfig | 1 + configs/galileo_defconfig | 1 + configs/microblaze-generic_defconfig | 1 + configs/odroid_defconfig | 1 + configs/origen_defconfig | 1 + configs/s5pc210_universal_defconfig | 1 + configs/socfpga_socrates_defconfig| 1 + configs/trats2_defconfig | 1 + configs/trats_defconfig | 1 + configs/zynq_microzed_defconfig | 1 + configs/zynq_zc70x_defconfig | 1 + configs/zynq_zc770_xm010_defconfig| 1 + configs/zynq_zc770_xm012_defconfig| 1 + configs/zynq_zc770_xm013_defconfig| 1 + configs/zynq_zed_defconfig| 1 + configs/zynq_zybo_defconfig | 1 + 23 files changed, 34 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7a2f91c..f0e6dec 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -597,6 +597,7 @@ config TEGRA select SUPPORT_SPL select SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL select CPU_V7 config TARGET_VEXPRESS64_AEMV8A @@ -690,6 +691,7 @@ config ARCH_UNIPHIER select SUPPORT_SPL select SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL endchoice diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index eb86a7f..46be502 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -7,6 +7,7 @@ config TARGET_SMDKV310 select SUPPORT_SPL bool Exynos4210 SMDKV310 board select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_TRATS bool Exynos4210 Trats board @@ -27,6 +28,7 @@ config TARGET_ODROID config TARGET_ODROID_XU3 bool Exynos5422 Odroid board select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_ARNDALE bool Exynos5250 Arndale board @@ -34,31 +36,37 @@ config TARGET_ARNDALE select CPU_V7_HAS_VIRT select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_SMDK5250 bool SMDK5250 board select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_SNOW bool Snow board select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_SMDK5420 bool SMDK5420 board select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_PEACH_PI bool Peach Pi board select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_PEACH_PIT bool Peach Pit board select SUPPORT_SPL select OF_CONTROL + select SPL_DISABLE_OF_CONTROL endchoice diff --git a/arch/arm/cpu/armv7/s5pc1xx/Kconfig b/arch/arm/cpu/armv7/s5pc1xx/Kconfig index bc73813..65cc9eb 100644 --- a/arch/arm/cpu/armv7/s5pc1xx/Kconfig +++ b/arch/arm/cpu/armv7/s5pc1xx/Kconfig @@ -6,10 +6,12 @@ choice config TARGET_S5P_GONI bool S5P Goni board select OF_CONTROL + select SPL_DISABLE_OF_CONTROL config TARGET_SMDKC100 bool Support smdkc100 board select OF_CONTROL + select SPL_DISABLE_OF_CONTROL endchoice diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index fccfd79..45b3148 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -47,6 +47,9 @@ config DM_I2C config DM_GPIO default y +config SPL_DISABLE_OF_CONTROL + default y + source arch/arm/mach-tegra/tegra20/Kconfig source arch/arm/mach-tegra/tegra30/Kconfig source arch/arm/mach-tegra/tegra114/Kconfig diff --git a/configs/Linksprite_pcDuino3_fdt_defconfig b/configs/Linksprite_pcDuino3_fdt_defconfig index 1e749cd..cf9e090 100644 --- a/configs/Linksprite_pcDuino3_fdt_defconfig +++ b/configs/Linksprite_pcDuino3_fdt_defconfig @@ -6,6 +6,7 @@ CONFIG_DM_GPIO=y CONFIG_DM_SERIAL=y CONFIG_DEFAULT_DEVICE_TREE=sun7i-a20-pcduino3 CONFIG_OF_CONTROL=y +CONFIG_SPL_DISABLE_OF_CONTROL=y CONFIG_OF_SEPARATE=y +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig index 51bf370..c241f47 100644 --- a/configs/am335x_boneblack_vboot_defconfig +++ b/configs/am335x_boneblack_vboot_defconfig @@ -3,6 +3,7 @@
[U-Boot] [PATCH 18/29] dm: Init device tree as well as driver model in SPL
If enabled, make sure that the device tree is available in SPL before setting up driver model. Signed-off-by: Simon Glass s...@chromium.org --- common/spl/spl.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index c655332..1e263b3 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -139,6 +139,8 @@ static void spl_ram_load_image(void) void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; + int ret; + debug(spl:board_init_r()\n); #if defined(CONFIG_SYS_SPL_MALLOC_START) @@ -149,9 +151,21 @@ void board_init_r(gd_t *dummy1, ulong dummy2) gd-malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd-malloc_ptr = 0; #endif -#ifdef CONFIG_SPL_DM - dm_init_and_scan(true); -#endif + if (IS_ENABLED(CONFIG_OF_CONTROL) + !IS_ENABLED(CONFIG_SPL_DISABLE_OF_CONTROL)) { + ret = fdtdec_setup(); + if (ret) { + debug(fdtdec_setup() returned error %d\n, ret); + hang(); + } + } + if (IS_ENABLED(CONFIG_SPL_DM)) { + ret = dm_init_and_scan(true); + if (ret) { + debug(dm_init_and_scan() returned error %d\n, ret); + hang(); + } + } #ifndef CONFIG_PPC /* -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 20/29] Remove SPL undefine of CONFIG_OF_CONTROL
Allow SPL to be built with this option so that we can support device tree control. Disable the simple bus for now in SPL. It may be needed later. Signed-off-by: Simon Glass s...@chromium.org --- drivers/core/Makefile | 2 ++ include/config_uncmd_spl.h | 2 ++ scripts/Makefile.uncmd_spl | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/core/Makefile b/drivers/core/Makefile index f14695b..a3fec38 100644 --- a/drivers/core/Makefile +++ b/drivers/core/Makefile @@ -5,5 +5,7 @@ # obj-$(CONFIG_DM) += device.o lists.o root.o uclass.o util.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_OF_CONTROL) += simple-bus.o +endif obj-$(CONFIG_DM_DEVICE_REMOVE) += device-remove.o diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h index 38cb0e8..c191f56 100644 --- a/include/config_uncmd_spl.h +++ b/include/config_uncmd_spl.h @@ -20,7 +20,9 @@ #undef CONFIG_CMD_SNTP #undef CONFIG_CMD_TFTPPUT #undef CONFIG_CMD_TFTPSRV +#ifdef CONFIG_SPL_DISABLE_OF_CONTROL #undef CONFIG_OF_CONTROL +#endif #ifndef CONFIG_SPL_DM #undef CONFIG_DM_SERIAL diff --git a/scripts/Makefile.uncmd_spl b/scripts/Makefile.uncmd_spl index 343c3fc..4f05652 100644 --- a/scripts/Makefile.uncmd_spl +++ b/scripts/Makefile.uncmd_spl @@ -3,7 +3,9 @@ # TODO: Invent a better way ifdef CONFIG_SPL_BUILD +ifdef CONFIG_SPL_DISABLE_OF_CONTROL CONFIG_OF_CONTROL= +endif ifndef CONFIG_SPL_DM CONFIG_DM_SERIAL= -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/29] dm: core: Remove unbind operations when not required
The CONFIG_DM_DEVICE_REMOVE option takes out code related to removing devices. It should also remove the 'unbind' code since if we cannot remove we probably don't need to unbind. Signed-off-by: Simon Glass s...@chromium.org --- drivers/core/uclass.c| 4 include/dm/uclass-internal.h | 8 2 files changed, 12 insertions(+) diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 289a5d2..e8282d2 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -344,6 +344,7 @@ err: return ret; } +#ifdef CONFIG_DM_DEVICE_REMOVE int uclass_unbind_device(struct udevice *dev) { struct uclass *uc; @@ -359,6 +360,7 @@ int uclass_unbind_device(struct udevice *dev) list_del(dev-uclass_node); return 0; } +#endif int uclass_resolve_seq(struct udevice *dev) { @@ -414,6 +416,7 @@ int uclass_post_probe_device(struct udevice *dev) return 0; } +#ifdef CONFIG_DM_DEVICE_REMOVE int uclass_pre_remove_device(struct udevice *dev) { struct uclass_driver *uc_drv; @@ -435,3 +438,4 @@ int uclass_pre_remove_device(struct udevice *dev) return 0; } +#endif diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index f2f254a..4a492d6 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -41,7 +41,11 @@ int uclass_bind_device(struct udevice *dev); * @dev: Pointer to the device * #return 0 on success, -ve on error */ +#ifdef CONFIG_DM_DEVICE_REMOVE int uclass_unbind_device(struct udevice *dev); +#else +static inline int uclass_unbind_device(struct udevice *dev) { return 0; } +#endif /** * uclass_pre_probe_child() - Deal with a child that is about to be probed @@ -73,7 +77,11 @@ int uclass_post_probe_device(struct udevice *dev); * @dev: Pointer to the device * #return 0 on success, -ve on error */ +#ifdef CONFIG_DM_DEVICE_REMOVE int uclass_pre_remove_device(struct udevice *dev); +#else +static inline int uclass_pre_remove_device(struct udevice *dev) { return 0; } +#endif /** * uclass_find() - Find uclass by its id -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] u-boot on raspberry 2: booting in SVC secure mode
On 02/26/2015 02:32 AM, Vincent wrote: I tried what Stephen suggested, and just changing CONFIG_SYS_TEXT_BASE to 0x0 (with kernel_old=1) does not work: the board display some garbage on the uart then hangs. The content of the garbage makes me thinks that nothing is done to handle the four cores in this setting which ends up badly. I expected this since raspberry's firmware only let one core run free. I think I need to configure U-boot so that it deals with this SMP scenario (I just don't know how). That expectation seems correct! I hacked in some code right at the start of U-Boot (reset: in arch/arm/cpu/armv7/start.S) that extracted the CPUID from the MPIDR register, and only allowed CPU0 to continue. With that in place, kernel_old=1 and CONFIG_SYS_TEXT_BASE=0 worked. Interesting that all CPU cores get released at reset; the other SoCs I've used only release CPU0 and you have to explicitly boot CPUn. My goal is to use U-boot to load some small homemade baremetal kernels on the raspberry (using serial or tftp loading), in *secure mode*, so I need U-boot to stay in secure mode, or at least let me install my own secure_monitor code before switching to non-secure mode. I made a couple attempts of adding secure mode support by adding options in configs/rpi_2_defconfig but they don't seem to be taken into account. Where do you suggest I put ARMV7_virt and ARMV7_NONSEC ? I would suggest adding #defines to include/configs/rpi_2.h. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] spl: fix calling spl export .. more than once
Hi Heiko, On 23 February 2015 at 23:04, Heiko Schocher h...@denx.de wrote: running spl export ... more than once fails with: Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order ERROR prep subcommand failed! Subcommand failed reason is commmit: 35fc84fa1f: Refactor the bootm command to reduce code duplication It used state != BOOTM_STATE_START but state is a bitfield, so check if the bit BOOTM_STATE_START is not set. With this fix, spl export ... can called more than once ... Signed-off-by: Heiko Schocher h...@denx.de The original code expected that only one flag would be passed at once (I think that was always the case when the code was first changed). But that is not how we want it to work. Reviewed-by: Simon Glass s...@chromium.org --- common/cmd_bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 48199bf..4f77f22 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -78,7 +78,8 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, return CMD_RET_USAGE; } - if (state != BOOTM_STATE_START images.state = state) { + if (((state BOOTM_STATE_START) != BOOTM_STATE_START) Maybe simpler as: if (!(state BOOTM_STATE_START) + images.state = state) { printf(Trying to execute a command out of order\n); return CMD_RET_USAGE; } -- 2.1.0 Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 10/29] fdt: sandbox: Move setup code from board_f to fdtdec
We want to be able to set up the device tree in SPL, so move this code to a common place. Signed-off-by: Simon Glass s...@chromium.org --- arch/sandbox/cpu/cpu.c| 41 +++ arch/sandbox/include/asm/u-boot-sandbox.h | 8 common/board_f.c | 67 +-- include/fdtdec.h | 6 +++ lib/fdtdec.c | 31 ++ 5 files changed, 88 insertions(+), 65 deletions(-) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 1aa397c..1e10452 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -6,6 +6,7 @@ #include common.h #include dm/root.h #include os.h +#include asm/io.h #include asm/state.h DECLARE_GLOBAL_DATA_PTR; @@ -70,3 +71,43 @@ phys_addr_t map_to_sysmem(const void *ptr) void flush_dcache_range(unsigned long start, unsigned long stop) { } + +int sandbox_read_fdt_from_file(void) +{ + struct sandbox_state *state = state_get_current(); + const char *fname = state-fdt_fname; + void *blob; + loff_t size; + int err; + int fd; + + blob = map_sysmem(CONFIG_SYS_FDT_LOAD_ADDR, 0); + if (!state-fdt_fname) { + err = fdt_create_empty_tree(blob, 256); + if (!err) + goto done; + printf(Unable to create empty FDT: %s\n, fdt_strerror(err)); + return -EINVAL; + } + + err = os_get_filesize(fname, size); + if (err 0) { + printf(Failed to file FDT file '%s'\n, fname); + return err; + } + fd = os_open(fname, OS_O_RDONLY); + if (fd 0) { + printf(Failed to open FDT file '%s'\n, fname); + return -EACCES; + } + if (os_read(fd, blob, size) != size) { + os_close(fd); + return -EIO; + } + os_close(fd); + +done: + gd-fdt_blob = blob; + + return 0; +} diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h index 770ab5c..6802618 100644 --- a/arch/sandbox/include/asm/u-boot-sandbox.h +++ b/arch/sandbox/include/asm/u-boot-sandbox.h @@ -27,4 +27,12 @@ int cleanup_before_linux(void); /* drivers/video/sandbox_sdl.c */ int sandbox_lcd_sdl_early_init(void); +/** + * sandbox_read_fdt_from_file() - Read a device tree from a file + * + * Read a device tree file from a host file and set it up for use as the + * control FDT. + */ +int sandbox_read_fdt_from_file(void); + #endif /* _U_BOOT_SANDBOX_H_ */ diff --git a/common/board_f.c b/common/board_f.c index 4d8b8a6..2499664 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -280,49 +280,6 @@ __weak int arch_cpu_init(void) return 0; } -#ifdef CONFIG_OF_HOSTFILE - -static int read_fdt_from_file(void) -{ - struct sandbox_state *state = state_get_current(); - const char *fname = state-fdt_fname; - void *blob; - loff_t size; - int err; - int fd; - - blob = map_sysmem(CONFIG_SYS_FDT_LOAD_ADDR, 0); - if (!state-fdt_fname) { - err = fdt_create_empty_tree(blob, 256); - if (!err) - goto done; - printf(Unable to create empty FDT: %s\n, fdt_strerror(err)); - return -EINVAL; - } - - err = os_get_filesize(fname, size); - if (err 0) { - printf(Failed to file FDT file '%s'\n, fname); - return err; - } - fd = os_open(fname, OS_O_RDONLY); - if (fd 0) { - printf(Failed to open FDT file '%s'\n, fname); - return -EACCES; - } - if (os_read(fd, blob, size) != size) { - os_close(fd); - return -EIO; - } - os_close(fd); - -done: - gd-fdt_blob = blob; - - return 0; -} -#endif - #ifdef CONFIG_SANDBOX static int setup_ram_buf(void) { @@ -335,28 +292,6 @@ static int setup_ram_buf(void) } #endif -static int setup_fdt(void) -{ -#ifdef CONFIG_OF_CONTROL -# ifdef CONFIG_OF_EMBED - /* Get a pointer to the FDT */ - gd-fdt_blob = __dtb_dt_begin; -# elif defined CONFIG_OF_SEPARATE - /* FDT is at end of image */ - gd-fdt_blob = (ulong *)_end; -# elif defined(CONFIG_OF_HOSTFILE) - if (read_fdt_from_file()) { - puts(Failed to read control FDT\n); - return -1; - } -# endif - /* Allow the early environment to override the fdt address */ - gd-fdt_blob = (void *)getenv_ulong(fdtcontroladdr, 16, - (uintptr_t)gd-fdt_blob); -#endif - return 0; -} - /* Get the top of usable RAM */ __weak ulong board_get_usable_ram_top(ulong total_size) { @@ -792,7 +727,9 @@ static init_fnc_t init_sequence_f[] = { setup_ram_buf, #endif setup_mon_len, +#ifdef CONFIG_OF_CONTROL setup_fdt, +#endif #ifdef
[U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
Hi, I am trying to run DFU in order to flash u-boot.imx into the SD card on a mx6qsabresd. The changes in config file are: --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -295,4 +295,10 @@ #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5 #define CONFIG_G_DNL_MANUFACTURER FSL +#define CONFIG_CMD_DFU +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC +#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M +#define DFU_DEFAULT_POLL_TIMEOUT 300 + #endif = mmc dev 1 = setenv dfu_alt_info 'boot raw 0x2 0x400' = save = dfu 0 mmc 1 Then on the host PC: $ sudo dfu-util -D u-boot.imx -a boot dfu-util 0.8 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-u...@lists.gnumonks.org dfu-util: Invalid DFU suffix signature dfu-util: A valid DFU suffix will be required in a future dfu-util release!!! Opening DFU capable USB device... ID 0525:a4a5 Run-time device DFU version 0110 Claiming USB DFU Interface... Setting Alternate Setting #0 ... Determining device status: state = dfuIDLE, status = 0 dfuIDLE, continuing DFU mode device DFU version 0110 Device returned transfer size 4096 Copying data from PC to DFU device Download[ ] 0%0 bytes failed! state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was and the following error is seen in U-boot: dfu_get_buf: Could not memalign 0x200 bytes Does anyone have any suggestions about this? Thanks, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] serial: ns16550: Fix build error due to a typo
Fix trivial typo. Signed-off-by: Axel Lin axel@ingics.com --- drivers/serial/ns16550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index eb00f1c..03beab5 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -80,7 +80,7 @@ static inline int serial_in_shift(unsigned char *addr, int shift) #elif defined(CONFIG_SYS_NS16550_MEM32) defined(CONFIG_SYS_BIG_ENDIAN) return in_be32(addr); #elif defined(CONFIG_SYS_BIG_ENDIAN) - return readb(addr + (1 reg_shift) - 1); + return readb(addr + (1 shift) - 1); #else return readb(addr); #endif -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fixdep: remove multiple .config support code
Since commit e02ee2548afe (kconfig: switch to single .config configuration), the .*.cmd files are not correctly created for SPL/TPL. The U-Boot extension code in fixdep, which was introduced to support the multiple .config, must be removed. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- Tom, Sorry, this is an urgent bug fix. scripts/basic/fixdep.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 1a41723..b304068 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -221,11 +221,7 @@ static void use_config(const char *m, int slen) define_config(m, slen, hash); - /* printf($(wildcard include/config/); */ - /* modified for U-Boot */ - printf($(wildcard %sinclude/config/, - strncmp(depfile, spl/, 4) ? - (strncmp(depfile, tpl/, 4) ? : tpl/) : spl/); + printf($(wildcard include/config/); for (i = 0; i slen; i++) { c = m[i]; if (c == '_') -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm64: Add Xilinx ZynqMP support
On Tue, Feb 24, 2015 at 09:02:09AM +0100, Michal Simek wrote: Add basic Xilinx ZynqMP arm64 support. Serial and SD is supported. It supports emulation platfrom ep108 and QEMU. Signed-off-by: Michal Simek michal.si...@xilinx.com [snip] +/* Miscellaneous configurable options */ +#define CONFIG_SYS_LOAD_ADDR 0x800 + +/* Initial environment variables */ +#define CONFIG_EXTRA_ENV_SETTINGS \ + ethaddr=00:0a:35:00:01:22\0 \ No, you can't hard-code an ethaddr in. + kernel_addr=0x20\0 \ + initrd_addr=0xa0\0 \ + initrd_size=0x200\0 \ These are really close together. And I imagine mirror the usual values on 32bit platforms. Maybe it's time to move them around a bit for more space? + fdt_addr=0x10\0 \ + fdt_high=0x1000\0 \ We also shouldn't have to play stop relocating the DT games on aarch64, right? Since all memory is visible and that's why we have to do those games on aarch32. + sdboot=mmcinfo fatload mmc 0:0 f00 system.dtb \ + fatload mmc 0:0 f00 Image booti 8 - f00\0 You aren't using $fdt_addr/$kernel_addr here and probably should? -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
Hello Fabio, On 02/27/2015 04:20 PM, Fabio Estevam wrote: Hi, I am trying to run DFU in order to flash u-boot.imx into the SD card on a mx6qsabresd. The changes in config file are: --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -295,4 +295,10 @@ #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5 #define CONFIG_G_DNL_MANUFACTURER FSL +#define CONFIG_CMD_DFU +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC +#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M +#define DFU_DEFAULT_POLL_TIMEOUT 300 + #endif = mmc dev 1 = setenv dfu_alt_info 'boot raw 0x2 0x400' = save = dfu 0 mmc 1 Then on the host PC: $ sudo dfu-util -D u-boot.imx -a boot dfu-util 0.8 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-u...@lists.gnumonks.org dfu-util: Invalid DFU suffix signature dfu-util: A valid DFU suffix will be required in a future dfu-util release!!! Opening DFU capable USB device... ID 0525:a4a5 Run-time device DFU version 0110 Claiming USB DFU Interface... Setting Alternate Setting #0 ... Determining device status: state = dfuIDLE, status = 0 dfuIDLE, continuing DFU mode device DFU version 0110 Device returned transfer size 4096 Copying data from PC to DFU device Download[ ] 0%0 bytes failed! state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was and the following error is seen in U-boot: dfu_get_buf: Could not memalign 0x200 bytes Does anyone have any suggestions about this? Thanks, Fabio Estevam Yes, please update line 33 in your config file, at least with this #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) + CONFIG_SYS_DFU_DATA_BUF_SIZE You don't have enough malloc memory reserved. Best regards, -- Przemyslaw Marczak Samsung RD Institute Poland Samsung Electronics p.marc...@samsung.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 16/29] fdt: Allow FDT functions to be built for SPL
Remove the implicit assumption that SPL does not support device tree. Signed-off-by: Simon Glass s...@chromium.org --- lib/Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/Makefile b/lib/Makefile index 07d175f..97ed398 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,6 +44,12 @@ obj-$(CONFIG_BITREVERSE) += bitrev.o obj-y += list_sort.o endif +ifndef CONFIG_SPL_DISABLE_OF_CONTROL +obj-$(CONFIG_OF_LIBFDT) += libfdt/ +obj-$(CONFIG_OF_CONTROL) += fdtdec_common.o +obj-$(CONFIG_OF_CONTROL) += fdtdec.o +endif + ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o obj-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] DWC2 driver issues
On 02/19/2015 07:29 AM, Marek Vasut wrote: On Monday, February 16, 2015 at 07:28:45 PM, Stephen Warren wrote: Following on from my Google+ post about DWC2/RPi USB host controller issues in U-Boot. ... On an RPi with the DWC2 controller connected directly to a single external USB connector (i.e model A, A+), a LS (and perhaps FS) device pluged directly into the board doesn't work due to the small max packet size limit. Your patch 9b1161af8c51 usb: dwc2: Add support for multi-packet control xfers in u-boot-usb.git topic/dwc2 addresses this issue for control transfers at least. With your patch, I can now enumerate a USB kbd on a model A+. That's a great improvement; thanks for the quick response with a patch. However, when I enable CONFIG_USB_KEYBOARD, I see errors when the USB keyboard input driver initializes: starting USB... USB0: Core Release: 2.80a scanning bus 0 for devices... 3 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found dev = 0df92ac0 pipe = 0x40408380 buf = 0db4a780 size = 8 int = 10 Failed to get keyboard state from device 413c:2010 I haven't investigated this further yet. Wow, this error is new, I have not seen this one on SoCFPGA. This error is because the keyboard driver uses interrupt transfers, and these aren't implemented in DWC2. I worked around this by forcing the keyboard driver to use control transfers, and fixing what I think is a bug in this case; see patch below. With this, USB keyboard works on an RPI A+, although it hangs pretty quickly. I assume one of the busy loops in dwc2.c without a time out isn't completing. diff --git a/common/usb_kbd.c b/common/usb_kbd.c index ecc3085cc081..237dbbaf4fe0 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -457,6 +457,8 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum) USB_KBD_BOOT_REPORT_SIZE, data-new, data-intinterval); if (!data-intq) { +#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) + if (0) { #else if (usb_submit_int_msg(dev, data-intpipe, data-new, data-intpktsize, data-intinterval) 0) { diff --git a/include/configs/rpi.h b/include/configs/rpi.h index c94f4112026e..8d01bc845d73 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -91,6 +91,9 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_MISC_INIT_R +#define CONFIG_USB_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP +#define CONFIG_SYS_STDIO_DEREGISTER #endif /* Console UART */ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Exynos: Clock: Fix exynos5_get_periph_rate for I2C.
Joonyoung, On 26/02/15 00:22, Guillaume GARDET wrote: Commit 2e82e9252695a612ab0cbf40fa0c7368515f6506 'Exynos: Clock: Cleanup soc_get_periph_rate' introduced a bug in I2C config. This patch makes cros_ec keyboard working again on Samsung Chromebook (snow). Signed-off-by: Guillaume GARDET guillaume.gar...@free.fr Cc: Akshay Saraswat aksha...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com Cc: Joonyoung Shim jy0922.s...@samsung.com --- arch/arm/cpu/armv7/exynos/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index c6455c2..7f47d4d 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -423,8 +423,8 @@ static unsigned long exynos5_get_periph_rate(int peripheral) case PERIPH_ID_I2C6: case PERIPH_ID_I2C7: src = EXYNOS_SRC_MPLL; - div = readl(clk-div_top0); - sub_div = readl(clk-div_top1); + sub_div = readl(clk-div_top0); + div = readl(clk-div_top1); break; default: debug(%s: invalid peripheral %d, __func__, peripheral); Could you please check this patch? Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] sunxi: Support uploading 'boot.scr' to RAM over USB OTG in FEL mode
On Tue, 2015-02-24 at 04:48 +0200, Siarhei Siamashka wrote: In order to fully support booting the whole system over USB OTG without relying on anything else (MMC, SATA, USB sticks, ...), it is possible to upload the 'boot.scr' file to DRAM using the 'fel' tool. But U-Boot still needs to be able to pick it up there before checking any other boot media. Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com --- The patch might be not the best way to implement this. But it would be great if U-Boot had out of the box support for: http://linux-sunxi.org/index.php?title=FEL/USBBootoldid=13134#Boot_the_whole_system_over_USB_.28u-boot_.2B_kernel_.2B_initramfs.29 One of the bad things about this patch is that the scriptaddr variable needs to be hardcoded and protected agaist modifications (if this address is to be used from the SPL). Perhaps use a separate dedicated/hardcoded address for the FEL boot script to avoid adding unusual semantics to $scriptaddr (which might surprise users not using fel)? If the FEL address has to be 0x4310 for compatibility with existing instructions/tools that might mean moving the current scriptaddr elsewhere. I think we can live with that. Also I'm not sure how this all could fit into the config_distro_bootcmd.h model, so I even have not tried that yet. Just at a quick glance, based on the PXE entry something like: #define BOOTENV_DEV_FEL(devtypeu, devtypel, instance) \ bootcmd_fel=source ...\0 i.e. all the magic params are irrelevant in this case. Perhaps bootcmd_#devtypel=...\0 but I don't think that's needed in this instance. BOOTENV_DEV_PXE doesn't bother at least. Then in BOOT_TARGET_DEVICES include func(FEL, fel, na) Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
Hello Fabio, On 02/27/2015 04:43 PM, Fabio Estevam wrote: Hi Przemyslaw, On Fri, Feb 27, 2015 at 12:35 PM, Przemyslaw Marczak p.marc...@samsung.com wrote: Yes, please update line 33 in your config file, at least with this #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) + CONFIG_SYS_DFU_DATA_BUF_SIZE You don't have enough malloc memory reserved. This fixes the problem :-) Thanks a lot for your help! No problem. You uncover one more thing, which should be done before change the dfu mmc static buffer with memalign, which is increase the malloc memory, for configs with dfu. Best regards, -- Przemyslaw Marczak Samsung RD Institute Poland Samsung Electronics p.marc...@samsung.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 04/14] ARM: Factor out reusable psci_cpu_entry
On Fri, 27 Feb 2015 13:28:03 + Jan Kiszka jan.kis...@siemens.com wrote: _sunxi_cpu_entry can be converted completely into a reusable psci_cpu_entry. Tegra124 will use it as well. CC: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/arm/cpu/armv7/psci.S | 18 ++ arch/arm/cpu/armv7/sunxi/psci.S | 20 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S index d688607..315c20b 100644 --- a/arch/arm/cpu/armv7/psci.S +++ b/arch/arm/cpu/armv7/psci.S @@ -170,4 +170,22 @@ ENTRY(psci_cpu_off_common) bx lr ENDPROC(psci_cpu_off_common) +ENTRY(psci_cpu_entry) + @ Set SMP bit + mrc p15, 0, r0, c1, c0, 1 @ ACTLR + orr r0, r0, #(1 6) @ Set SMP bit + mcr p15, 0, r0, c1, c0, 1 @ ACTLR + isb + + bl _nonsec_init + + adr r0, _psci_target_pc + ldr r0, [r0] + b _do_nonsec_entry +ENDPROC(psci_cpu_entry) I'd add a *big* comment at the top of this. ACTLR is implementation dependent, and while sticking the SMP bit at this location is fairly common among ARM cores, it is by no mean a strong guarantee (this is not an architectural feature). I'd recommend making it override-able. +.globl _psci_target_pc +_psci_target_pc: + .word 0 + .popsection diff --git a/arch/arm/cpu/armv7/sunxi/psci.S b/arch/arm/cpu/armv7/sunxi/psci.S index bb3d4ef..9ea3ce8 100644 --- a/arch/arm/cpu/armv7/sunxi/psci.S +++ b/arch/arm/cpu/armv7/sunxi/psci.S @@ -139,7 +139,7 @@ out: mcr p15, 0, r7, c1, c1, 0 @ r2 = target PC .globl psci_cpu_on psci_cpu_on: - adr r0, _target_pc + ldr r0, =_psci_target_pc str r2, [r0] dsb @@ -151,7 +151,7 @@ psci_cpu_on: mov r4, #1 lsl r4, r4, r1 - adr r6, _sunxi_cpu_entry + ldr r6, =psci_cpu_entry str r6, [r0, #0x1a4] @ PRIVATE_REG (boot vector) @ Assert reset on target CPU @@ -197,22 +197,6 @@ psci_cpu_on: mov r0, #ARM_PSCI_RET_SUCCESS @ Return PSCI_RET_SUCCESS mov pc, lr -_target_pc: - .word 0 - -_sunxi_cpu_entry: - @ Set SMP bit - mrc p15, 0, r0, c1, c0, 1 - orr r0, r0, #0x40 - mcr p15, 0, r0, c1, c0, 1 - isb - - bl _nonsec_init - - adr r0, _target_pc - ldr r0, [r0] - b _do_nonsec_entry - .globl psci_cpu_off psci_cpu_off: bl psci_cpu_off_common -- Jazz is not dead. It just smells funny. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/6] sandbox: Implement host dev [device]
On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote: Hi Sjoerd, On 19 February 2015 at 15:41, Sjoerd Simons sjoerd.sim...@collabora.co.uk wrote: A common pattern to check if a certain device exists (e.g. in config_distro_bootcmd) is to use: interface dev [device] Implement host dev [device] so this pattern can be used for sandbox host devices. I don't see where this actually affects anything? In other words, does it really use the device you select, or just ignore you? It gets ignored, it's only real usage is to detect whether a device exists. To step back the reason I implemented it here is just to make it simpler to integrate with the command boot commands as it's common blockdevice macro is: #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \ if #devtypel dev ${devnum}; then \ setenv devtype #devtypel ; \ run scan_dev_for_boot_part; \ fi\0 Which follows exactly that pattern. Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk --- common/cmd_sandbox.c | 48 1 file changed, 48 insertions(+) diff --git a/common/cmd_sandbox.c b/common/cmd_sandbox.c index 4286969..7447d43 100644 --- a/common/cmd_sandbox.c +++ b/common/cmd_sandbox.c @@ -10,6 +10,8 @@ #include sandboxblockdev.h + ret = host_get_dev_err(dev, blk_dev); + if (ret) { + if (ret == -ENOENT) + puts(Not bound to a backing file\n); Just use printf(), we should avoid puts() now. ok + else if (ret == -ENODEV) + puts(Invalid host device number\n); + + return 1; + } + + sandbox_curr_device = dev; + return 0; +} + +U_BOOT_CMD( + host, 3, 2, do_host_dev, + Set or get current host device, dev [dev] - Set or retrieve the current host device Can we make this command part of the 'sb' command? Like 'sh host ...'. In principle, sure, however that breaks the consistency with other commands which all use interface interface-commands, where interface matches the names used in the fs and partition commands. Which is exactly the consistency _distro_bootcmd takes advantage of in the macro i mentioned above. My thinking was that the sb set of commands are used to manage/setup the sandbox interface (e.g. setting up the host device bindings) while in this case the host commands are for the more standard interaction with host interface devices. Another way of addressing this and essentially side-stepping this discussion would be to add a a new generic dev command to allow testing device existance e.g. dev exists host 0 dev exists mmc 0 And switch _distro_bootcmd to that instead of it relying on all block interfaces having a dev subcommand with the same semantics. Opinions ? :) -- Sjoerd Simons sjoerd.sim...@collabora.co.uk Collabora Ltd. smime.p7s Description: S/MIME cryptographic signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] please pull u-boot-samsung master
Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S -- Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] please pull u-boot-samsung master
Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S -- Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 0/26] ARM: UniPhier: bug fixes, refactorings and new features
2015-02-27 2:26 GMT+09:00 Masahiro Yamada yamad...@jp.panasonic.com: This series contains: - bug fixes and refactoring of SBC init code - add missing reset controls - support 1CS support card for all the SoCs - add xHCI driver Masahiro Yamada (26): ARM: UniPhier: move SoC sources to mach-uniphier ARM: UniPhier: move SoC headers to mach-uniphier/include/mach ARM: UniPhier: include mach/*.h instead of asm/arch/*.h ARM: UniPhier: update defconfigs using savedefconfig serial: UniPhier: use 32 bit register access serial: UniPhier: move LCR register setting to probe function ARM: UniPhier: fix comments in PH1-Pro4 SBC code ARM: UniPhier: fix SBC init code ARM: UniPhier: rename SC_CLKCTRL_CLK_* to SC_SCLKCTRL_CEN_* ARM: UniPhier: split clkrst_init() into two functions ARM: UniPhier: reset NAND core in SPL for non-NAND boot mode ARM: UniPhier: enable STDMAC for EHCI ARM: UniPhier: remove EHCI platform devices ARM: UniPhier: move uniphier_ehci_reset() function ARM: UniPhier: replace usb-ehci with generic-ehci ARM: UniPhier: add I/O pin settings for xHCI on PH1-Pro4 ARM: UniPhier: enable xHCI and GIO cores for PH1-Pro4 ARM: UniPhier: add xHCI device nodes to PH1-Pro4 device tree usb: UniPhier: add UniPhier on-chip xHCI host driver support ARM: UniPhier: switch to xHCI for PH1-Pro4 ARM: UniPhier: support 1CS support card for all the UniPhier SoCs ARM: UniPhier: switch to 1CS support card ARM: UniPhier: consolidate MEMCONF setting code ARM: UniPhier: remove stop_mpll() from PH1-Pro4 PLL initialization ARM: UniPhier: remove SSC_WAY_SIZE and SSC_NUM_ENTRIES macros ARM: UniPhier: move CONFIG_SYS_TEXT_BASE to Kconfig Series, applied to u-boot-uniphier/master, except 26/26, which has been deferred. -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-Boot stuck after relocation attempt on MX51 board
Hi Benoît, On Thu, Feb 26, 2015 at 6:10 PM, Benoît Thébaudeau benoit.thebaudeau@gmail.com wrote: That's because CONFIG_HAS_VBAR is set for ARMv7. There may be an issue, though: according to Freescale, the TrustZone security extensions are present on i.MX514/515/516/53x, but not on i.MX512/513. According to ARM, the security extensions seem to always be implemented on Cortex-A8, so it's not clear what Freescale means for i.MX512/513, and if the non-secure VBAR is still available on these. If not, 0x is the boot ROM, and 0x is reserved, just like on i.MX25/27/31/35, so disabling CONFIG_HAS_VBAR for i.MX512/513 would not help, and your vector relocation patch would be required here too. It would be nice if someone could test the latest U-Boot on i.MX512/513. That's a good point. I don't have access to the mx512/mx513 variants though. Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] pxe: Ensure all memory access is to mapped memory
On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote: Hi Sjoerd, On 19 February 2015 at 15:41, Sjoerd Simons sjoerd.sim...@collabora.co.uk wrote: Properly map memory through map_sysmem so that pxe can be used from the sandbox. Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk Please run your patches through patman as you seem to have style violations. Also can you add some notes about how you have tested this on real hardware? Will do for the next round together with addressing your comments. One confused me tough, see below. --- common/cmd_pxe.c | 80 1 file changed, 46 insertions(+), 34 deletions(-) @@ -1281,13 +1288,14 @@ static int parse_label(char **c, struct pxe_menu *cfg) * * Returns 1 on success, 0 on error. */ -static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, struct pxe_menu *cfg, int nest_level) +static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long b, + struct pxe_menu *cfg, int nest_level) s/b/base/ or something more meaningful (fix above/below also) { struct token t; - char *s, *b, *label_name; + char *s, *label_name, *base; int err; - b = p; + base = p; This worries me - assigning a pointer to a ulong. base is a pointer here though. So this comment confuses me. -- Sjoerd Simons sjoerd.sim...@collabora.co.uk Collabora Ltd. smime.p7s Description: S/MIME cryptographic signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] please pull u-boot-samsung master
Dear Tom, The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: http://git.denx.de/u-boot-samsung for you to fetch changes up to 306f527eff269e48a98c9d83016df6d6877dbb6a: Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 (2015-02-28 18:03:46 +0900) Akshay Saraswat (9): Exynos542x: Config: Add various configs Exynos542x: CPU: Power down all secondary cores Exynos542x: Add workaround for ARM errata 798870 Exynos542x: Add workaround for ARM errata 799270 Exynos542x: Add workaround for exynos iROM errata Exynos542x: cache: Disable clean/evict push to external Exynos542x: add L2 control register configuration Exynos542x: Fix secondary core booting for thumb Exynos542x: Make A7s boot with thumb-mode U-Boot on warm reset Doug Anderson (1): Exynos: Fix L2 cache timings on Exynos5420 and Exynos5800 arch/arm/cpu/armv7/exynos/Makefile|2 + arch/arm/cpu/armv7/exynos/common_setup.h | 62 arch/arm/cpu/armv7/exynos/exynos5_setup.h |3 + arch/arm/cpu/armv7/exynos/lowlevel_init.c | 147 + arch/arm/cpu/armv7/exynos/sec_boot.S | 128 + arch/arm/cpu/armv7/exynos/soc.c | 35 --- arch/arm/include/asm/arch-exynos/cpu.h|5 + arch/arm/include/asm/arch-exynos/system.h | 88 + arch/arm/include/asm/armv7.h | 44 + include/configs/exynos5420-common.h | 16 10 files changed, 495 insertions(+), 35 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/sec_boot.S -- Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] config_distro_bootcmd.h: Add shared block definition for the host interface
+Stephen for real this time Hi Sjoerd, On 28 February 2015 at 07:05, Sjoerd Simons sjoerd.sim...@collabora.co.uk wrote: On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote: +Stephen who knows more about this stuff On 19 February 2015 at 15:41, Sjoerd Simons sjoerd.sim...@collabora.co.uk wrote: Define the common shared block environment for the host interface in preperation for the sandbox build to use config_distro_bootcmd. Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk --- include/config_distro_bootcmd.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 07a0b3b..ff0e3a8 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -32,6 +32,18 @@ #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \ #devtypel #instance +#ifdef CONFIG_SANDBOX +#define BOOTENV_SHARED_HOSTBOOTENV_SHARED_BLKDEV(host) +#define BOOTENV_DEV_HOST BOOTENV_DEV_BLKDEV +#define BOOTENV_DEV_NAME_HOST BOOTENV_DEV_NAME_BLKDEV +#else +#define BOOTENV_SHARED_HOST +#define BOOTENV_DEV_HOST \ + BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX +#define BOOTENV_DEV_NAME_HOST \ Can we use upper case in #defines? The reason for this is that it is consistent with all other block device blocks in that file e.g: #define BOOTENV_DEV_SATA \ BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA So i'd prefer to to keep it that way. Btw, note that this is used for compile time error reporting rather then something you'd refer to in code. OK I see. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] config_distro_bootcmd.h: Add shared block definition for the host interface
On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote: +Stephen who knows more about this stuff On 19 February 2015 at 15:41, Sjoerd Simons sjoerd.sim...@collabora.co.uk wrote: Define the common shared block environment for the host interface in preperation for the sandbox build to use config_distro_bootcmd. Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk --- include/config_distro_bootcmd.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 07a0b3b..ff0e3a8 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -32,6 +32,18 @@ #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \ #devtypel #instance +#ifdef CONFIG_SANDBOX +#define BOOTENV_SHARED_HOSTBOOTENV_SHARED_BLKDEV(host) +#define BOOTENV_DEV_HOST BOOTENV_DEV_BLKDEV +#define BOOTENV_DEV_NAME_HOST BOOTENV_DEV_NAME_BLKDEV +#else +#define BOOTENV_SHARED_HOST +#define BOOTENV_DEV_HOST \ + BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX +#define BOOTENV_DEV_NAME_HOST \ Can we use upper case in #defines? The reason for this is that it is consistent with all other block device blocks in that file e.g: #define BOOTENV_DEV_SATA \ BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA So i'd prefer to to keep it that way. Btw, note that this is used for compile time error reporting rather then something you'd refer to in code. -- Sjoerd Simons sjoerd.sim...@collabora.co.uk Collabora Ltd. smime.p7s Description: S/MIME cryptographic signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-Boot stuck after relocation attempt on MX51 board
Hi Dave, On Thu, Feb 26, 2015 at 7:01 PM, Benoît Thébaudeau benoit.thebaudeau@gmail.com wrote: You will probably have to make a few adjustments, but that should not be too heavy. There have been many changes in the infrastructure of U-Boot lately, mainly revolving around the integration of Kconfig, Kbuild and the driver model. At worst, you should have to upgrade your config / make / maintainers files, and maybe adjust your code for a few changes in the driver APIs. To have an idea: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=history;f=board/freescale/mx51evk;hpb=refs/tags/v2014.07;hb=refs/tags/v2015.01 In addition to what Benoît said, you could consider upstreaming your board support, so that you don't have to worry about upgrading U-boot in the future. As I understand you have started with 2009.08, then moved to 2014.07 and plan to move to 2015.01. Also please keep in mind that we are in the process of moving to 2015.04 :-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd_usb_mass_storage: Remove extra 'ums' string in the usage text
Hi Soeren, On Fri, Feb 27, 2015 at 10:20 AM, Soeren Moch sm...@web.de wrote: Currently the usage text for the 'ums' command looks like this: Usage: ums ums USB_controller [devtype] devnum e.g. ums 0 mmc 0 ,so remove the extra 'ums' in the text. Signed-off-by: Fabio Estevam fabio.este...@freescale.com When fixing the ums help text, I think we also should change the long name from User Mass Storage to USB Mass Storage. Maybe a separate patch for this? Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: Machine id hack to prevent loading buggy sunxi-3.4 kernels
On Sat, 2015-02-21 at 11:49 +0100, Hans de Goede wrote: On 21-02-15 11:26, Ian Campbell wrote: Speaking of which, if someone were to identify a suitable set of simple-fb backports for 3.16 and they are reasonably self contained I'd happily backport them to the kenrel which is going to be in the next Debian release too... You will need all patches by me and by Luc Verhaegen from here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/video/fbdev/simplefb.c As well as these dts patches: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=5790d4ee1e425fefef0e012d1415c25baeb9dae8 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=d501841fc42a97a8b69449135eadf6e9c4589a87 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=e53a8b2201384ee1a2cfd1609c9ffdf951b041a1 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=8efc5c2be5b29f7ceec83bb471da81690273e141 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=678e75d I inserted this one here so the following stuff would cherry-pick ok, I think that was the right thing to do. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=a9f8cda32a3acc3150755fe973f7fa1867a7a5d6 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=8cedd6628472aa2d8f2f54dfcc36633e46a59db8 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fd18c7eac03540654abdbfedd52e6dfb3718b489 Those combined with a new enough u-boot should get you video output on most devices supported in upstream u-boot. Indeed, this gets me graphics on my Cubietruck at least. Thanks! Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx6slevk: Provide a proper pad configuration for OTG1_ID pin
From: Fabio Estevam fabio.este...@freescale.com Pass the same pad configuration as done in the kernel so that OTG1_ID pin can properly work in device mode. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- board/freescale/mx6slevk/mx6slevk.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index c65f72b..7c18c90 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -50,6 +50,11 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ PAD_CTL_ODE | PAD_CTL_SRE_FAST) +#define OTGID_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |\ + PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW |\ + PAD_CTL_DSE_80ohm | PAD_CTL_HYS | \ + PAD_CTL_SRE_FAST) + #define ETH_PHY_RESET IMX_GPIO_NR(4, 21) int dram_init(void) @@ -285,7 +290,7 @@ static int setup_fec(void) static iomux_v3_cfg_t const usb_otg_pads[] = { /* OTG1 */ MX6_PAD_KEY_COL4__USB_USBOTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), - MX6_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID | MUX_PAD_CTRL(OTGID_PAD_CTRL), /* OTG2 */ MX6_PAD_KEY_COL5__USB_USBOTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL) }; -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request: u-boot-uniphier
Hi Tom, Please pull clean-ups, bug-fixes, new features for UniPhier platform. The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55: Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 18:14:18 -0500) are available in the git repository at: git://git.denx.de/u-boot-uniphier.git master for you to fetch changes up to 105a9e705efaeeac63e795e2a184b0a18db0ac5a: ARM: UniPhier: remove SSC_WAY_SIZE and SSC_NUM_ENTRIES macros (2015-03-01 00:03:21 +0900) Masahiro Yamada (25): ARM: UniPhier: move SoC sources to mach-uniphier ARM: UniPhier: move SoC headers to mach-uniphier/include/mach ARM: UniPhier: include mach/*.h instead of asm/arch/*.h ARM: UniPhier: update defconfigs using savedefconfig serial: UniPhier: use 32 bit register access serial: UniPhier: move LCR register setting to probe function ARM: UniPhier: fix comments in PH1-Pro4 SBC code ARM: UniPhier: fix SBC init code ARM: UniPhier: rename SC_CLKCTRL_CLK_* to SC_SCLKCTRL_CEN_* ARM: UniPhier: split clkrst_init() into two functions ARM: UniPhier: reset NAND core in SPL for non-NAND boot mode ARM: UniPhier: enable STDMAC for EHCI ARM: UniPhier: remove EHCI platform devices ARM: UniPhier: move uniphier_ehci_reset() function ARM: UniPhier: replace usb-ehci with generic-ehci ARM: UniPhier: add I/O pin settings for xHCI on PH1-Pro4 ARM: UniPhier: enable xHCI and GIO cores for PH1-Pro4 ARM: UniPhier: add xHCI device nodes to PH1-Pro4 device tree usb: UniPhier: add UniPhier on-chip xHCI host driver support ARM: UniPhier: switch to xHCI for PH1-Pro4 ARM: UniPhier: support 1CS support card for all the UniPhier SoCs ARM: UniPhier: switch to 1CS support card ARM: UniPhier: consolidate MEMCONF setting code ARM: UniPhier: remove stop_mpll() from PH1-Pro4 PLL initialization ARM: UniPhier: remove SSC_WAY_SIZE and SSC_NUM_ENTRIES macros MAINTAINERS| 3 +- arch/arm/Kconfig | 2 +- arch/arm/Makefile | 1 + arch/arm/cpu/armv7/Makefile| 1 - arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c | 28 arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c | 29 arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c | 75 arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c | 28 arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c | 29 arch/arm/dts/uniphier-ph1-ld4.dtsi | 8 +-- arch/arm/dts/uniphier-ph1-pro4-ref.dts | 5 +- arch/arm/dts/uniphier-ph1-pro4.dtsi | 22 -- arch/arm/dts/uniphier-ph1-sld3.dtsi | 10 +-- arch/arm/dts/uniphier-ph1-sld8.dtsi | 8 +-- arch/arm/include/asm/arch-uniphier/ehci-uniphier.h | 33 - arch/arm/{cpu/armv7/uniphier = mach-uniphier}/Kconfig | 0 arch/arm/{cpu/armv7/uniphier = mach-uniphier}/Makefile| 1 + arch/arm/{cpu/armv7/uniphier = mach-uniphier}/board_common.c | 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/board_early_init_f.c | 9 ++- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/board_early_init_r.c| 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/board_late_init.c | 0 arch/arm/{cpu/armv7/uniphier = mach-uniphier}/cache_uniphier.c| 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/cmd_ddrphy.c| 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/cmd_pinmon.c| 4 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/cpu_info.c | 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/ddrphy_training.c | 2 +- arch/arm/{cpu/armv7/uniphier = mach-uniphier}/dram_init.c | 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/arm-mpcore.h | 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/bcu-regs.h| 0 .../{include/asm/arch-uniphier = mach-uniphier/include/mach}/board.h | 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/boot-device.h | 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/ddrphy-regs.h | 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/debug-uart.S | 0 .../{include/asm/arch-uniphier = mach-uniphier/include/mach}/led.h| 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/mio-regs.h| 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/platdevice.h | 2 - .../asm/arch-uniphier = mach-uniphier/include/mach}/sbc-regs.h| 0 .../asm/arch-uniphier = mach-uniphier/include/mach}/sc-regs.h | 29 +--- .../asm/arch-uniphier = mach-uniphier/include/mach}/sg-regs.h | 119 +---
[U-Boot] [PATCH v2 2/2] cmd_usb_mass_storage: Use 'USB Mass Storage' in the help text
From: Fabio Estevam fabio.este...@freescale.com USB Mass Storage is the standard name, so let's use it here. Suggested-by: Soeren Moch sm...@web.de Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - Newly introduced in this series common/cmd_usb_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index 51c3fff..7bc1e4d 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -158,7 +158,7 @@ exit: } U_BOOT_CMD(ums, 4, 1, do_usb_mass_storage, - Use the UMS [User Mass Storage], + Use the UMS [USB Mass Storage], USB_controller [devtype] devnum e.g. ums 0 mmc 0\n devtype defaults to mmc ); -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/2] cmd_usb_mass_storage: Remove extra 'ums' string in the usage text
From: Fabio Estevam fabio.este...@freescale.com Currently the usage text for the 'ums' command looks like this: Usage: ums ums USB_controller [devtype] devnum e.g. ums 0 mmc 0 ,so remove the extra 'ums' in the text. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Otavio Salvador ota...@ossystems.com.br Acked-by: Marek Vasut ma...@denx.de --- Changes since v1: - None common/cmd_usb_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index 2c879ea..51c3fff 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -159,6 +159,6 @@ exit: U_BOOT_CMD(ums, 4, 1, do_usb_mass_storage, Use the UMS [User Mass Storage], - ums USB_controller [devtype] devnum e.g. ums 0 mmc 0\n + USB_controller [devtype] devnum e.g. ums 0 mmc 0\n devtype defaults to mmc ); -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd_usb_mass_storage: Remove extra 'ums' string in the usage text
On Saturday, February 28, 2015 at 05:04:09 PM, Fabio Estevam wrote: Hi Soeren, On Fri, Feb 27, 2015 at 10:20 AM, Soeren Moch sm...@web.de wrote: Currently the usage text for the 'ums' command looks like this: Usage: ums ums USB_controller [devtype] devnum e.g. ums 0 mmc 0 ,so remove the extra 'ums' in the text. Signed-off-by: Fabio Estevam fabio.este...@freescale.com When fixing the ums help text, I think we also should change the long name from User Mass Storage to USB Mass Storage. Maybe a separate patch for this? Separate please . Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/2] warp: Add USB Mass Storage support
From: Fabio Estevam fabio.este...@freescale.com With UMS support we are able to flash the eMMC from U-boot, which is very convenient. Add UMS support to make the eMMC flashing process easier. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - Use the standard 'USB Mass Storage' term board/warp/warp.c | 6 ++ include/configs/warp.h | 26 ++ 2 files changed, 32 insertions(+) diff --git a/board/warp/warp.c b/board/warp/warp.c index 3b275c2..21ac5e7 100644 --- a/board/warp/warp.c +++ b/board/warp/warp.c @@ -21,6 +21,7 @@ #include watchdog.h #include fsl_esdhc.h #include mmc.h +#include usb.h DECLARE_GLOBAL_DATA_PTR; @@ -82,6 +83,11 @@ int board_mmc_init(bd_t *bis) return fsl_esdhc_initialize(bis, usdhc_cfg[0]); } +int board_usb_phy_mode(int port) +{ + return USB_INIT_DEVICE; +} + int board_early_init_f(void) { setup_iomux_uart(); diff --git a/include/configs/warp.h b/include/configs/warp.h index 82036e4..cfc2323 100644 --- a/include/configs/warp.h +++ b/include/configs/warp.h @@ -120,6 +120,32 @@ #define CONFIG_CMD_CACHE #endif +/* USB Configs */ +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT1 /* Only OTG2 port enabled */ +#endif + +#define CONFIG_CI_UDC +#define CONFIG_USBD_HS +#define CONFIG_USB_GADGET_DUALSPEED + +#define CONFIG_USB_GADGET +#define CONFIG_CMD_USB_MASS_STORAGE +#define CONFIG_USB_GADGET_MASS_STORAGE +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_USB_GADGET_VBUS_DRAW2 + +#define CONFIG_G_DNL_VENDOR_NUM0x0525 +#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5 +#define CONFIG_G_DNL_MANUFACTURER FSL + #define CONFIG_EXTRA_ENV_SETTINGS \ script=boot.scr\0 \ image=zImage\0 \ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/2] warp: Select BOUNCE_BUFFER and CMD_EXT options
From: Fabio Estevam fabio.este...@freescale.com Add EXT2/EXT4 and BOUNCE_BUFFER support. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Changes since v1: - None include/configs/warp.h | 4 1 file changed, 4 insertions(+) diff --git a/include/configs/warp.h b/include/configs/warp.h index cfc2323..8379cec 100644 --- a/include/configs/warp.h +++ b/include/configs/warp.h @@ -46,6 +46,10 @@ #define CONFIG_MMC #define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_BOUNCE_BUFFER +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_EXT4_WRITE #define CONFIG_CMD_FAT #define CONFIG_DOS_PARTITION -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] apalis/colibri_t30: fix MMC/SD card detect GPIOs
This fixes the MMC/SD card detect GPIOs for Apalis T30 which got broken by the following commit: 2b2b50bc8748 dm: tegra: dts: Use TEGRA_GPIO() macro for all GPIOs While at it also re-add the comments describing which particular Apalis/Colibri pins those GPIOs are on. Signed-off-by: Marcel Ziswiler mar...@ziswiler.com Reviewed-by: Simon Glass s...@chromium.org Acked-by: Stefan Agner stefan.ag...@toradex.com --- Changes in v2: - Include commit subject too when referencing a previous commit as suggested by Stephen arch/arm/dts/tegra30-apalis.dts | 9 +++-- arch/arm/dts/tegra30-colibri.dts | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/dts/tegra30-apalis.dts b/arch/arm/dts/tegra30-apalis.dts index 75c5d5f..13ab42b 100644 --- a/arch/arm/dts/tegra30-apalis.dts +++ b/arch/arm/dts/tegra30-apalis.dts @@ -247,13 +247,15 @@ sdhci@7800 { status = okay; bus-width = 4; - cd-gpios = gpio TEGRA_GPIO(CC, 5) GPIO_ACTIVE_HIGH; + /* SD1_CD# */ + cd-gpios = gpio TEGRA_GPIO(CC, 5) GPIO_ACTIVE_LOW; }; sdhci@78000400 { status = okay; bus-width = 8; - cd-gpios = gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH; + /* MMC1_CD# */ + cd-gpios = gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_LOW; }; sdhci@78000600 { @@ -266,12 +268,14 @@ usb@7d00 { status = okay; dr_mode = peripheral; + /* USBO1_EN */ nvidia,vbus-gpio = gpio TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH; }; /* EHCI instance 1: USB2_DP/N - USBH2_DP/N */ usb@7d004000 { status = okay; + /* USBH_EN */ nvidia,vbus-gpio = gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH; phy_type = utmi; }; @@ -279,6 +283,7 @@ /* EHCI instance 2: USB3_DP/N - USBH3_DP/N */ usb@7d008000 { status = okay; + /* USBH_EN */ nvidia,vbus-gpio = gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH; }; diff --git a/arch/arm/dts/tegra30-colibri.dts b/arch/arm/dts/tegra30-colibri.dts index 6cd1902..36533dc 100644 --- a/arch/arm/dts/tegra30-colibri.dts +++ b/arch/arm/dts/tegra30-colibri.dts @@ -64,7 +64,7 @@ sdhci@78000200 { status = okay; bus-width = 4; - cd-gpios = gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW; + cd-gpios = gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW; /* MMCD */ }; sdhci@78000600 { @@ -83,12 +83,14 @@ usb@7d004000 { status = okay; phy_type = utmi; + /* VBUS_LAN */ nvidia,vbus-gpio = gpio TEGRA_GPIO(DD, 2) GPIO_ACTIVE_HIGH; }; /* EHCI instance 2: USB3_DP/N - USBH_P/N */ usb@7d008000 { status = okay; + /* USBH_PEN */ nvidia,vbus-gpio = gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW; }; }; -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/2] warp: Add USB Mass Storage support
On Sat, Feb 28, 2015 at 3:16 PM, Fabio Estevam feste...@gmail.com wrote: From: Fabio Estevam fabio.este...@freescale.com With UMS support we are able to flash the eMMC from U-boot, which is very convenient. Add UMS support to make the eMMC flashing process easier. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Otavio Salvador ota...@ossystems.com.br -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/4] apalis/colibri_t30: add misc cmds increase buf sizes and max args
On Tue, 2015-02-17 at 13:38 -0700, Stephen Warren wrote: CONFIG_CMDLINE_EDITING README isn't very informative on this subject. What does this add? I can already up-arrow and edit command-lines on all Tegra devices. If it's not that big, I wonder if enabling it for all Tegra would make sense? CONFIG_CMD_FS_GENERIC Isn't that already set as part of the generic distro boot support? include/config_distro_defaults.h:#define CONFIG_CMD_FS_GENERIC Yes, you are absolutely right. Both were actually already set via config_distro_defaults.h which I missed noticing, sorry about that. I will drop those two from a v2. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/2] warp: Select BOUNCE_BUFFER and CMD_EXT options
On Sat, Feb 28, 2015 at 3:16 PM, Fabio Estevam feste...@gmail.com wrote: From: Fabio Estevam fabio.este...@freescale.com Add EXT2/EXT4 and BOUNCE_BUFFER support. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Otavio Salvador ota...@ossystems.com.br -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] dm: tegra: dts: add aliases for spi on apalis_t30
All boards with a SPI interface have a suitable spi alias except Apalis T30. Add these missing aliases just as the following commit did for the others: d2f60f93325a dm: tegra: dts: Add aliases for spi on tegra30 boards Signed-off-by: Marcel Ziswiler mar...@ziswiler.com --- Changes in v2: - Include commit subject too when referencing a previous commit as suggested by Stephen arch/arm/dts/tegra30-apalis.dts | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/tegra30-apalis.dts b/arch/arm/dts/tegra30-apalis.dts index 15db0f2..75c5d5f 100644 --- a/arch/arm/dts/tegra30-apalis.dts +++ b/arch/arm/dts/tegra30-apalis.dts @@ -18,6 +18,10 @@ sdhci0 = /sdhci@78000600; sdhci1 = /sdhci@78000400; sdhci2 = /sdhci@7800; + spi0 = /spi@7000d400; + spi1 = /spi@7000dc00; + spi2 = /spi@7000de00; + spi3 = /spi@7000da00; usb0 = /usb@7d00; usb1 = /usb@7d004000; usb2 = /usb@7d008000; -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 4/4] apalis/colibri_t30: add misc cmds increase buf sizes and max args
In order to work with our downstream U-Boot environment and update scripts add support for the following miscellaneous commands: CONFIG_CMD_SETEXPR CONFIG_FAT_WRITE Increase the console I/O and print as well as argument buffer sizes: CONFIG_SYS_CBSIZE CONFIG_SYS_PBSIZE CONFIG_SYS_BARGSIZE Increase the maximum number of arguments allowed: CONFIG_SYS_MAXARGS Signed-off-by: Marcel Ziswiler mar...@ziswiler.com --- Changes in v2: - Drop CONFIG_CMDLINE_EDITING and CONFIG_CMD_FS_GENERIC as they already get pulled in via config_distro_defaults.h as noted by Stephen include/configs/apalis_t30.h | 19 +++ include/configs/colibri_t30.h | 24 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index b301f9e..ca9982e 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -62,6 +62,25 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP +/* Miscellaneous commands */ +#define CONFIG_CMD_SETEXPR +#define CONFIG_FAT_WRITE + +/* Increase console I/O buffer size */ +#undef CONFIG_SYS_CBSIZE +#define CONFIG_SYS_CBSIZE 1024 + +/* Increase arguments buffer size */ +#undef CONFIG_SYS_BARGSIZE +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +/* Increase print buffer size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) + +/* Increase maximum number of arguments */ +#undef CONFIG_SYS_MAXARGS +#define CONFIG_SYS_MAXARGS 32 + #include tegra-common-usb-gadget.h #include tegra-common-post.h diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h index ce6f23b..f785046 100644 --- a/include/configs/colibri_t30.h +++ b/include/configs/colibri_t30.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 Stefan Agner + * Copyright (c) 2013-2015 Stefan Agner * * SPDX-License-Identifier:GPL-2.0+ */ @@ -11,10 +11,11 @@ #include tegra30-common.h +/* High-level configuration options */ #define V_PROMPT Colibri T30 # #define CONFIG_TEGRA_BOARD_STRING Toradex Colibri T30 -/* Board-specific config */ +/* Board-specific serial config */ #define CONFIG_SERIAL_MULTI #define CONFIG_TEGRA_ENABLE_UARTA #define CONFIG_SYS_NS16550_COM1NV_PA_APB_UARTA_BASE @@ -54,6 +55,25 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP +/* Miscellaneous commands */ +#define CONFIG_CMD_SETEXPR +#define CONFIG_FAT_WRITE + +/* Increase console I/O buffer size */ +#undef CONFIG_SYS_CBSIZE +#define CONFIG_SYS_CBSIZE 1024 + +/* Increase arguments buffer size */ +#undef CONFIG_SYS_BARGSIZE +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +/* Increase print buffer size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) + +/* Increase maximum number of arguments */ +#undef CONFIG_SYS_MAXARGS +#define CONFIG_SYS_MAXARGS 32 + #include tegra-common-usb-gadget.h #include tegra-common-post.h -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/4] various fixes for apalis/colibri_t30
The following is a set of various fixes for Toradex Apalis and Colibri T30. Changes in v2: - Include commit subject too when referencing a previous commit as suggested by Stephen - Add various acked- and reviewed-by - Drop CONFIG_CMDLINE_EDITING and CONFIG_CMD_FS_GENERIC as they already get pulled in via config_distro_defaults.h as noted by Stephen Marcel Ziswiler (4): dm: tegra: dts: add aliases for spi on apalis_t30 apalis/colibri_t30: fix MMC/SD card detect GPIOs apalis_t30: enable gigabit ethernet via pcie apalis/colibri_t30: add misc cmds increase buf sizes and max args arch/arm/dts/tegra30-apalis.dts | 13 +++-- arch/arm/dts/tegra30-colibri.dts | 4 +++- include/configs/apalis_t30.h | 29 ++--- include/configs/colibri_t30.h| 24 ++-- 4 files changed, 58 insertions(+), 12 deletions(-) -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/4] apalis_t30: enable gigabit ethernet via pcie
Now with all the Tegra PCIe and Intel E1000 gigabit Ethernet driver updates being merged actually make use of it. While at it get rid of the USB networking support which now does not make much sense any longer. Signed-off-by: Marcel Ziswiler mar...@ziswiler.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v2: None include/configs/apalis_t30.h | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index 61809fc..b301f9e 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Marcel Ziswiler + * Copyright (c) 2014-2015 Marcel Ziswiler * * SPDX-License-Identifier:GPL-2.0+ */ @@ -47,12 +47,8 @@ #define CONFIG_USB_STORAGE #define CONFIG_CMD_USB -/* USB networking support */ -#define CONFIG_USB_HOST_ETHER -#define CONFIG_USB_ETHER_ASIX - /* PCI host support */ -#undef CONFIG_PCI /* just define once Tegra PCIe support got merged */ +#define CONFIG_PCI #define CONFIG_PCI_TEGRA #define CONFIG_PCI_PNP #define CONFIG_CMD_PCI @@ -60,7 +56,7 @@ /* PCI networking support */ #define CONFIG_E1000 -#undef CONFIG_E1000_NO_NVM /* just define once E1000 driver got fixed */ +#define CONFIG_E1000_NO_NVM /* General networking support */ #define CONFIG_CMD_NET -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4] ARM: Add ARMv7-M support
Signed-off-by: Kamil Lulko re...@wp.pl --- arch/arm/Kconfig | 4 ++ arch/arm/cpu/armv7m/Makefile | 10 + arch/arm/cpu/armv7m/config.mk | 8 arch/arm/cpu/armv7m/cpu.c | 35 arch/arm/cpu/armv7m/start.S | 15 +++ arch/arm/include/asm/armv7m.h | 60 +++ arch/arm/lib/Makefile | 8 +++- arch/arm/lib/crt0.S | 30 ++ arch/arm/lib/interrupts_m.c | 95 +++ arch/arm/lib/relocate.S | 13 ++ arch/arm/lib/vectors_m.S | 57 ++ 11 files changed, 333 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/armv7m/Makefile create mode 100644 arch/arm/cpu/armv7m/config.mk create mode 100644 arch/arm/cpu/armv7m/cpu.c create mode 100644 arch/arm/cpu/armv7m/start.S create mode 100644 arch/arm/include/asm/armv7m.h create mode 100644 arch/arm/lib/interrupts_m.c create mode 100644 arch/arm/lib/vectors_m.S diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 41f3220..29ea8b4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -33,6 +33,9 @@ config CPU_V7 bool select HAS_VBAR +config CPU_V7M + bool + config CPU_PXA bool @@ -47,6 +50,7 @@ config SYS_CPU default arm1136 if CPU_ARM1136 default arm1176 if CPU_ARM1176 default armv7 if CPU_V7 +default armv7m if CPU_V7M default pxa if CPU_PXA default sa1100 if CPU_SA1100 default armv8 if ARM64 diff --git a/arch/arm/cpu/armv7m/Makefile b/arch/arm/cpu/armv7m/Makefile new file mode 100644 index 000..a187f6e --- /dev/null +++ b/arch/arm/cpu/armv7m/Makefile @@ -0,0 +1,10 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +extra-y := start.o +obj-y += cpu.o + diff --git a/arch/arm/cpu/armv7m/config.mk b/arch/arm/cpu/armv7m/config.mk new file mode 100644 index 000..0b31e44 --- /dev/null +++ b/arch/arm/cpu/armv7m/config.mk @@ -0,0 +1,8 @@ +# +# (C) Copyright 2015 +# Kamil Lulko, re...@wp.pl +# +# SPDX-License-Identifier: GPL-2.0+ +# + +PLATFORM_CPPFLAGS += -march=armv7-m -mthumb diff --git a/arch/arm/cpu/armv7m/cpu.c b/arch/arm/cpu/armv7m/cpu.c new file mode 100644 index 000..d3ab862 --- /dev/null +++ b/arch/arm/cpu/armv7m/cpu.c @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2010,2011 + * Vladimir Khusainov, Emcraft Systems, v...@emcraft.com + * + * (C) Copyright 2015 + * Kamil Lulko, re...@wp.pl + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/armv7m.h + +/* + * This is called right before passing control to + * the Linux kernel point. + */ +int cleanup_before_linux(void) +{ + return 0; +} + +/* + * Perform the low-level reset. + */ +void reset_cpu(ulong addr) +{ + /* +* Perform reset but keep priority group unchanged. +*/ + writel((V7M_AIRCR_VECTKEY V7M_AIRCR_VECTKEY_SHIFT) + | (V7M_SCB-aircr V7M_AIRCR_PRIGROUP_MSK) + | V7M_AIRCR_SYSRESET, V7M_SCB-aircr); +} diff --git a/arch/arm/cpu/armv7m/start.S b/arch/arm/cpu/armv7m/start.S new file mode 100644 index 000..e05e984 --- /dev/null +++ b/arch/arm/cpu/armv7m/start.S @@ -0,0 +1,15 @@ +/* + * (C) Copyright 2015 + * Kamil Lulko, re...@wp.pl + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +.globl reset +.type reset, %function +reset: + b _main + +.globl c_runtime_cpu_setup +c_runtime_cpu_setup: + mov pc, lr diff --git a/arch/arm/include/asm/armv7m.h b/arch/arm/include/asm/armv7m.h new file mode 100644 index 000..d2aa1c4 --- /dev/null +++ b/arch/arm/include/asm/armv7m.h @@ -0,0 +1,60 @@ +/* + * (C) Copyright 2010,2011 + * Vladimir Khusainov, Emcraft Systems, v...@emcraft.com + * + * (C) Copyright 2015 + * Kamil Lulko, re...@wp.pl + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef ARMV7M_H +#define ARMV7M_H + +#if defined(__ASSEMBLY__) +.syntax unified +.thumb +#endif + +#define V7M_SCB_BASE 0xE000ED00 +#define V7M_MPU_BASE 0xE000ED90 + +#define V7M_SCB_VTOR 0x08 + +#if !defined(__ASSEMBLY__) +struct v7m_scb { + uint32_t cpuid; /* CPUID Base Register */ + uint32_t icsr; /* Interrupt Control and State Register */ + uint32_t vtor; /* Vector Table Offset Register */ + uint32_t aircr; /* App Interrupt and Reset Control Register */ +}; +#define V7M_SCB((struct v7m_scb *)V7M_SCB_BASE) + +#define V7M_AIRCR_VECTKEY 0x5fa +#define V7M_AIRCR_VECTKEY_SHIFT16 +#define V7M_AIRCR_ENDIAN (1 15) +#define V7M_AIRCR_PRIGROUP_SHIFT 8 +#define V7M_AIRCR_PRIGROUP_MSK (0x7 V7M_AIRCR_PRIGROUP_SHIFT) +#define V7M_AIRCR_SYSRESET (1 2) + +#define V7M_ICSR_VECTACT_MSK 0xFF + +struct v7m_mpu { + uint32_t type;
[U-Boot] [PATCH 3/4] stm32f4: Add serial driver
Signed-off-by: Kamil Lulko re...@wp.pl --- drivers/serial/Makefile | 1 + drivers/serial/serial.c | 2 + drivers/serial/serial_stm32.c | 117 ++ 3 files changed, 120 insertions(+) create mode 100644 drivers/serial/serial_stm32.c diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 63b0cbf..eb935bf 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -45,6 +45,7 @@ obj-$(CONFIG_TEGRA_SERIAL) += serial_tegra.o obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o obj-$(CONFIG_OMAP_SERIAL) += serial_omap.o obj-$(CONFIG_X86_SERIAL) += serial_x86.o +obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_USB_TTY) += usbtty.o diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 95c992a..9249a77 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -155,6 +155,7 @@ serial_initfunc(sa1100_serial_initialize); serial_initfunc(sandbox_serial_initialize); serial_initfunc(sconsole_serial_initialize); serial_initfunc(sh_serial_initialize); +serial_initfunc(stm32_serial_initialize); serial_initfunc(uartlite_serial_initialize); serial_initfunc(zynq_serial_initialize); @@ -248,6 +249,7 @@ void serial_initialize(void) sandbox_serial_initialize(); sconsole_serial_initialize(); sh_serial_initialize(); + stm32_serial_initialize(); uartlite_serial_initialize(); zynq_serial_initialize(); diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c new file mode 100644 index 000..3c80096 --- /dev/null +++ b/drivers/serial/serial_stm32.c @@ -0,0 +1,117 @@ +/* + * (C) Copyright 2015 + * Kamil Lulko, re...@wp.pl + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include serial.h +#include asm/arch/stm32.h + +#define STM32_USART1_BASE (STM32_APB2PERIPH_BASE + 0x1000) +#define RCC_APB2ENR_USART1EN (1 4) + +#define USART_BASE STM32_USART1_BASE +#define RCC_USART_ENABLE RCC_APB2ENR_USART1EN + +struct stm32_serial { + u32 sr; + u32 dr; + u32 brr; + u32 cr1; + u32 cr2; + u32 cr3; + u32 gtpr; +}; + +#define USART_CR1_RE (1 2) +#define USART_CR1_TE (1 3) +#define USART_CR1_UE (1 13) + +#define USART_SR_FLAG_RXNE (1 5) +#define USART_SR_FLAG_TXE (1 7) + +#define USART_BRR_F_MASK 0xF +#define USART_BRR_M_SHIFT 4 +#define USART_BRR_M_MASK 0xFFF0 + +DECLARE_GLOBAL_DATA_PTR; + +static void stm32_serial_setbrg(void) +{ + serial_init(); +} + +static int stm32_serial_init(void) +{ + struct stm32_serial *usart = (struct stm32_serial *)USART_BASE; + u32 clock, int_div, frac_div, tmp; + + if ((USART_BASE STM32_BUS_MASK) == STM32_APB1PERIPH_BASE) { + setbits_le32(STM32_RCC-apb1enr, RCC_USART_ENABLE); + clock = clock_get(CLOCK_APB1); + } else if ((USART_BASE STM32_BUS_MASK) == STM32_APB2PERIPH_BASE) { + setbits_le32(STM32_RCC-apb2enr, RCC_USART_ENABLE); + clock = clock_get(CLOCK_APB2); + } else { + return -1; + } + + int_div = (25 * clock) / (4 * gd-baudrate); + tmp = ((int_div / 100) USART_BRR_M_SHIFT) USART_BRR_M_MASK; + frac_div = int_div - (100 * (tmp USART_BRR_M_SHIFT)); + tmp |= (((frac_div * 16) + 50) / 100) USART_BRR_F_MASK; + + writel(tmp, usart-brr); + setbits_le32(usart-cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE); + + return 0; +} + +static int stm32_serial_getc(void) +{ + struct stm32_serial *usart = (struct stm32_serial *)USART_BASE; + while ((readl(usart-sr) USART_SR_FLAG_RXNE) == 0) + ; + return readl(usart-dr); +} + +static void stm32_serial_putc(const char c) +{ + struct stm32_serial *usart = (struct stm32_serial *)USART_BASE; + while ((readl(usart-sr) USART_SR_FLAG_TXE) == 0) + ; + writel(c, usart-dr); +} + +static int stm32_serial_tstc(void) +{ + struct stm32_serial *usart = (struct stm32_serial *)USART_BASE; + u8 ret; + + ret = readl(usart-sr) USART_SR_FLAG_RXNE; + return ret; +} + +static struct serial_device stm32_serial_drv = { + .name = stm32_serial, + .start = stm32_serial_init, + .stop = NULL, + .setbrg = stm32_serial_setbrg, + .putc = stm32_serial_putc, + .puts = default_serial_puts, + .getc = stm32_serial_getc, + .tstc = stm32_serial_tstc, +}; + +void stm32_serial_initialize(void) +{ + serial_register(stm32_serial_drv); +} + +__weak struct serial_device *default_serial_console(void) +{ + return stm32_serial_drv; +} -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/4] Add support for stm32f429-discovery board
The following patches implement basic support for the ARMv7-M microcontroller architecture. Additionally, stm32f429-discovery board support is added with tested ability to boot uClinux from the embedded Flash memory. Kamil Lulko (4): ARM: Add ARMv7-M support ARMv7M: Add STM32F4 support stm32f4: Add serial driver stm32f4: Add support for stm32f429-discovery board arch/arm/Kconfig | 9 + arch/arm/cpu/armv7m/Makefile | 11 + arch/arm/cpu/armv7m/config.mk | 8 + arch/arm/cpu/armv7m/cpu.c | 35 +++ arch/arm/cpu/armv7m/start.S| 15 ++ arch/arm/cpu/armv7m/stm32f4/Makefile | 11 + arch/arm/cpu/armv7m/stm32f4/clock.c| 209 +++ arch/arm/cpu/armv7m/stm32f4/flash.c| 143 ++ arch/arm/cpu/armv7m/stm32f4/soc.c | 37 +++ arch/arm/cpu/armv7m/stm32f4/timer.c| 118 + arch/arm/include/asm/arch-stm32f4/fmc.h| 75 ++ arch/arm/include/asm/arch-stm32f4/gpio.h | 116 + arch/arm/include/asm/arch-stm32f4/stm32.h | 108 arch/arm/include/asm/armv7m.h | 60 + arch/arm/lib/Makefile | 8 +- arch/arm/lib/crt0.S| 30 +++ arch/arm/lib/interrupts_m.c| 95 +++ arch/arm/lib/relocate.S| 13 + arch/arm/lib/vectors_m.S | 57 board/st/stm32f429-discovery/Kconfig | 19 ++ board/st/stm32f429-discovery/MAINTAINERS | 6 + board/st/stm32f429-discovery/Makefile | 12 + board/st/stm32f429-discovery/led.c | 35 +++ board/st/stm32f429-discovery/stm32f429-discovery.c | 288 + configs/stm32f429-discovery_defconfig | 2 + drivers/gpio/Makefile | 1 + drivers/gpio/stm32_gpio.c | 199 ++ drivers/serial/Makefile| 1 + drivers/serial/serial.c| 2 + drivers/serial/serial_stm32.c | 117 + include/configs/stm32f429-discovery.h | 106 include/flash.h| 2 + 32 files changed, 1946 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/armv7m/Makefile create mode 100644 arch/arm/cpu/armv7m/config.mk create mode 100644 arch/arm/cpu/armv7m/cpu.c create mode 100644 arch/arm/cpu/armv7m/start.S create mode 100644 arch/arm/cpu/armv7m/stm32f4/Makefile create mode 100644 arch/arm/cpu/armv7m/stm32f4/clock.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/flash.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/soc.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/timer.c create mode 100644 arch/arm/include/asm/arch-stm32f4/fmc.h create mode 100644 arch/arm/include/asm/arch-stm32f4/gpio.h create mode 100644 arch/arm/include/asm/arch-stm32f4/stm32.h create mode 100644 arch/arm/include/asm/armv7m.h create mode 100644 arch/arm/lib/interrupts_m.c create mode 100644 arch/arm/lib/vectors_m.S create mode 100644 board/st/stm32f429-discovery/Kconfig create mode 100644 board/st/stm32f429-discovery/MAINTAINERS create mode 100644 board/st/stm32f429-discovery/Makefile create mode 100644 board/st/stm32f429-discovery/led.c create mode 100644 board/st/stm32f429-discovery/stm32f429-discovery.c create mode 100644 configs/stm32f429-discovery_defconfig create mode 100644 drivers/gpio/stm32_gpio.c create mode 100644 drivers/serial/serial_stm32.c create mode 100644 include/configs/stm32f429-discovery.h -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4] ARMv7M: Add STM32F4 support
Signed-off-by: Kamil Lulko re...@wp.pl --- arch/arm/cpu/armv7m/Makefile | 1 + arch/arm/cpu/armv7m/stm32f4/Makefile | 11 ++ arch/arm/cpu/armv7m/stm32f4/clock.c | 209 ++ arch/arm/cpu/armv7m/stm32f4/flash.c | 143 arch/arm/cpu/armv7m/stm32f4/soc.c | 37 ++ arch/arm/cpu/armv7m/stm32f4/timer.c | 118 + arch/arm/include/asm/arch-stm32f4/fmc.h | 75 +++ arch/arm/include/asm/arch-stm32f4/gpio.h | 116 + arch/arm/include/asm/arch-stm32f4/stm32.h | 108 +++ drivers/gpio/Makefile | 1 + drivers/gpio/stm32_gpio.c | 199 include/flash.h | 2 + 12 files changed, 1020 insertions(+) create mode 100644 arch/arm/cpu/armv7m/stm32f4/Makefile create mode 100644 arch/arm/cpu/armv7m/stm32f4/clock.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/flash.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/soc.c create mode 100644 arch/arm/cpu/armv7m/stm32f4/timer.c create mode 100644 arch/arm/include/asm/arch-stm32f4/fmc.h create mode 100644 arch/arm/include/asm/arch-stm32f4/gpio.h create mode 100644 arch/arm/include/asm/arch-stm32f4/stm32.h create mode 100644 drivers/gpio/stm32_gpio.c diff --git a/arch/arm/cpu/armv7m/Makefile b/arch/arm/cpu/armv7m/Makefile index a187f6e..b662e03 100644 --- a/arch/arm/cpu/armv7m/Makefile +++ b/arch/arm/cpu/armv7m/Makefile @@ -8,3 +8,4 @@ extra-y := start.o obj-y += cpu.o +obj-$(CONFIG_STM32F4) += stm32f4/ diff --git a/arch/arm/cpu/armv7m/stm32f4/Makefile b/arch/arm/cpu/armv7m/stm32f4/Makefile new file mode 100644 index 000..e982830 --- /dev/null +++ b/arch/arm/cpu/armv7m/stm32f4/Makefile @@ -0,0 +1,11 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2015 +# Kamil Lulko, re...@wp.pl +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += soc.o clock.o timer.o flash.o diff --git a/arch/arm/cpu/armv7m/stm32f4/clock.c b/arch/arm/cpu/armv7m/stm32f4/clock.c new file mode 100644 index 000..2eded1f --- /dev/null +++ b/arch/arm/cpu/armv7m/stm32f4/clock.c @@ -0,0 +1,209 @@ +/* + * (C) Copyright 2015 + * Kamil Lulko, re...@wp.pl + * + * (C) Copyright 2014 + * STMicroelectronics + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/arch/stm32.h + +#define RCC_CR_HSION (1 0) +#define RCC_CR_HSEON (1 16) +#define RCC_CR_HSERDY (1 17) +#define RCC_CR_HSEBYP (1 18) +#define RCC_CR_CSSON (1 19) +#define RCC_CR_PLLON (1 24) +#define RCC_CR_PLLRDY (1 25) + +#define RCC_PLLCFGR_PLLM_MASK 0x3F +#define RCC_PLLCFGR_PLLN_MASK 0x7FC0 +#define RCC_PLLCFGR_PLLP_MASK 0x3 +#define RCC_PLLCFGR_PLLQ_MASK 0xF00 +#define RCC_PLLCFGR_PLLSRC (1 22) +#define RCC_PLLCFGR_PLLN_SHIFT 6 +#define RCC_PLLCFGR_PLLP_SHIFT 16 +#define RCC_PLLCFGR_PLLQ_SHIFT 24 + +#define RCC_CFGR_AHB_PSC_MASK 0xF0 +#define RCC_CFGR_APB1_PSC_MASK 0x1C00 +#define RCC_CFGR_APB2_PSC_MASK 0xE000 +#define RCC_CFGR_SW0 (1 0) +#define RCC_CFGR_SW1 (1 1) +#define RCC_CFGR_SW_MASK 0x3 +#define RCC_CFGR_SW_HSI0 +#define RCC_CFGR_SW_HSERCC_CFGR_SW0 +#define RCC_CFGR_SW_PLLRCC_CFGR_SW1 +#define RCC_CFGR_SWS0 (1 2) +#define RCC_CFGR_SWS1 (1 3) +#define RCC_CFGR_SWS_MASK 0xC +#define RCC_CFGR_SWS_HSI 0 +#define RCC_CFGR_SWS_HSE RCC_CFGR_SWS0 +#define RCC_CFGR_SWS_PLL RCC_CFGR_SWS1 +#define RCC_CFGR_HPRE_SHIFT4 +#define RCC_CFGR_PPRE1_SHIFT 10 +#define RCC_CFGR_PPRE2_SHIFT 13 + +#define RCC_APB1ENR_PWREN (1 28) + +#define PWR_CR_VOS0(1 14) +#define PWR_CR_VOS1(1 15) +#define PWR_CR_VOS_MASK0xC000 +#define PWR_CR_VOS_SCALE_MODE_1(PWR_CR_VOS0 | PWR_CR_VOS1) +#define PWR_CR_VOS_SCALE_MODE_2(PWR_CR_VOS1) +#define PWR_CR_VOS_SCALE_MODE_3(PWR_CR_VOS0) + +#define FLASH_ACR_WS(n)n +#define FLASH_ACR_PRFTEN (1 8) +#define FLASH_ACR_ICEN (1 9) +#define FLASH_ACR_DCEN (1 10) + +struct pll_psc { + u8 pll_m; + u16 pll_n; + u8 pll_p; + u8 pll_q; + u8 ahb_psc; + u8 apb1_psc; + u8 apb2_psc; +}; + +#define AHB_PSC_1 0 +#define AHB_PSC_2 0x8 +#define AHB_PSC_4 0x9 +#define AHB_PSC_8 0xA +#define AHB_PSC_16 0xB +#define AHB_PSC_64 0xC +#define AHB_PSC_1280xD +#define AHB_PSC_2560xE +#define AHB_PSC_5120xF + +#define APB_PSC_1 0 +#define APB_PSC_2 0x4 +#define APB_PSC_4 0x5 +#define APB_PSC_8 0x6 +#define APB_PSC_16 0x7 + +#if