Skip to contentSkip to conversation

sunxi: initial upstreaming effort

PATCH Superseded Ian Campbell 8 participants 28 messages May 5, 2014 – Jun 3, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v5 cover sunxi: initial upstreaming effort

This is my fifth attempt at an upstreamable series based upon the
https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet.

The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e 3f5ff92b1503 "sunxi: add comments to pll1_para array." and applies to u-boot v2014.04. It merges cleanly into current mainline head.

As of v4 the majority of the series now has at least one Ack or Reviewed-by. In summary:

  +  sunxi: add sun7i clocks and timer support.
mT   sunxi: add sun7i pinmux and gpio support
M    sunxi: add sun7i dram setup support
M +  sunxi: add sun7i cpu, board and start of day support
MT   sunxi: add support for Cubietruck booting in FEL mode
M    sunxi: add gmac Ethernet support
M    sunxi: mmc support
M    sunxi: non-FEL SPL boot support for sun7i

M==Reviewed-by Marek Vasut.
m==Acked-by Marek Vasut.
T==Reviewed-by Tom Rini
+==Minor changes in v5

Changes in v5:
- Resynced with u-boot-sunxi.git 3f5ff92b1503 "sunxi: add comments to pll1_para array.". Dropped "Reduce DMA burst length" patch which is being handled elsewhere. Otherwise see individual commit logs for details.

Changes in v4:
- Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments.

Global changes in v3:
- Rebased onto v2014.04 and resynced with u-boot-sunxi.git c89867dca2e9
- Improved commit messages
- Updated lists of contributors
- Added some CCs
- Lots of cleanup based on review comments.

Global changes in v2:
- Use SPDX-License-Identifier
- Resync with u-boot-sunxi.git
- Lot of updates to the individual patches, see the individual commit messages (checkpatch.pl fixes, magic number removal etc).
- Pulled the Ethernet stuff before the MMC and non-FEL boot stuff. The MMC stuff (which non-FEL boot needs) still needs some more cleanup, but the reordering means that the initial part of the series could in principal go in.

This series can also be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5

There is no SMP here, since that relies on the PSCI support from Marc Zyngier which has yet to land in mainline. Marc has recently rebased and a version based on this series can be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5-smp

I've tried to give corect credit and S-o-b based upon:
git log --pretty='%aN' linux-sunxi/sunxi -- [PATHS] | sort -u git log linux-sunxi/sunxi -- [PATHS] | grep -i signed.off.by | sort -u Manual inspection

This will tend to over credit, since it will include folks who contributed code which has since been removed as well as those who contributed code which is not included in this patch set, but I think it is better to be conservative and include too many rather than incorrectly exclude people. Doing better than this would be IMHO too hard to be worth it (e.g. git blame would prefer a recent whitespace cleanup to the actual author of the code and prefer someone did code motion over the original author, so it would be a massive & manual process).

[0] https://github.com/linux-sunxi/u-boot-sunxi.git

#1 lore raw

PATCH v5 1/8 sunxi: add sun7i clocks and timer support.

This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- add comments to pll1_para array.
- hz parameter to clock_set_pll1 => an unsigned int.

v4: "Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- clock_get_pll6 moved to clock_sun4i.c.
- fixed coding style of comment in read_timer.

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- define magic numbers
- simplify get_tbclk
- correct clock_set_pll1 prototype
- add CONFIG_SUN7I to simplify future SUN?I support.
- defines for MMC AHB clocks

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 arch/arm/cpu/armv7/sunxi/Makefile             |  12 ++
 arch/arm/cpu/armv7/sunxi/clock.c              |  25 +++
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c        | 188 +++++++++++++++++++
 arch/arm/cpu/armv7/sunxi/timer.c              | 113 ++++++++++++
 arch/arm/include/asm/arch-sunxi/clock.h       |  29 +++
 arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 256 ++++++++++++++++++++++++++
 arch/arm/include/asm/arch-sunxi/sys_proto.h   |  16 ++
 arch/arm/include/asm/arch-sunxi/timer.h       |  88 +++++++++
 8 files changed, 727 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/sunxi/Makefile
 create mode 100644 arch/arm/cpu/armv7/sunxi/clock.c
 create mode 100644 arch/arm/cpu/armv7/sunxi/clock_sun4i.c
 create mode 100644 arch/arm/cpu/armv7/sunxi/timer.c
 create mode 100644 arch/arm/include/asm/arch-sunxi/clock.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/clock_sun4i.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/timer.h
arch/arm/cpu/armv7/sunxi/Makefile new file +12 -0
new file mode 100644
index 0000000..440d266
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2012 Henrik Nordstrom <[email protected]>
+#
+# Based on some other Makefile
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+obj-y	+= timer.o
+obj-y	+= clock.o
+obj-$(CONFIG_SUN7I)	+= clock_sun4i.o
arch/arm/cpu/armv7/sunxi/clock.c new file +25 -0
new file mode 100644
index 0000000..47fb70f
@@ -0,0 +1,25 @@
+/*
+ * (C) Copyright 2007-2012
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Tom Cubie <[email protected]>
+ *
+ * (C) Copyright 2013 Luke Kenneth Casson Leighton <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/sys_proto.h>
+
+int clock_init(void)
+{
+#ifdef CONFIG_SPL_BUILD
+	clock_init_safe();
+#endif
+	clock_init_uart();
+
+	return 0;
+}
arch/arm/cpu/armv7/sunxi/clock_sun4i.c new file +188 -0

188 lines not on this page · raw message

arch/arm/cpu/armv7/sunxi/timer.c new file +113 -0

113 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/clock.h new file +29 -0
new file mode 100644
index 0000000..5669f39
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2007-2011
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Tom Cubie <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _SUNXI_CLOCK_H
+#define _SUNXI_CLOCK_H
+
+#include <linux/types.h>
+
+#define CLK_GATE_OPEN			0x1
+#define CLK_GATE_CLOSE			0x0
+
+/* clock control module regs definition */
+#include <asm/arch/clock_sun4i.h>
+
+#ifndef __ASSEMBLY__
+int clock_init(void);
+int clock_twi_onoff(int port, int state);
+void clock_set_pll1(unsigned int hz);
+unsigned int clock_get_pll6(void);
+void clock_init_safe(void);
+void clock_init_uart(void);
+#endif
+
+#endif /* _SUNXI_CLOCK_H */
arch/arm/include/asm/arch-sunxi/clock_sun4i.h new file +256 -0

256 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/sys_proto.h new file +16 -0
new file mode 100644
index 0000000..c3e636e
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2007-2012
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Tom Cubie <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _SYS_PROTO_H_
+#define _SYS_PROTO_H_
+
+#include <linux/types.h>
+
+void sdelay(unsigned long);
+
+#endif
arch/arm/include/asm/arch-sunxi/timer.h new file +88 -0

88 lines not on this page · raw message

Signature · 1 line
1.9.0
#2 lore raw

PATCH v5 1/8 sunxi: add sun7i clocks and timer support.

Quoted 7 lines · Ian Campbell

This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant.

Quoted 11 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/28d696bb/attachment.pgp>
#3 lore raw

PATCH v5 2/8 sunxi: add sun7i pinmux and gpio support

In reply to Ian Campbell

This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- No changes required

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- Additional pin definitions

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 arch/arm/cpu/armv7/sunxi/Makefile      |   1 +
 arch/arm/cpu/armv7/sunxi/pinmux.c      |  61 ++++++++++++++
 arch/arm/include/asm/arch-sunxi/gpio.h | 147 +++++++++++++++++++++++++++++++++
 3 files changed, 209 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/sunxi/pinmux.c
 create mode 100644 arch/arm/include/asm/arch-sunxi/gpio.h
arch/arm/cpu/armv7/sunxi/Makefile +1 -0
index 440d266..529e7ec 100644
@@ -9,4 +9,5 @@
 #
 obj-y	+= timer.o
 obj-y	+= clock.o
+obj-y	+= pinmux.o
 obj-$(CONFIG_SUN7I)	+= clock_sun4i.o
arch/arm/cpu/armv7/sunxi/pinmux.c new file +61 -0

61 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/gpio.h new file +147 -0

147 lines not on this page · raw message

Signature · 1 line
1.9.0
#4 lore raw

PATCH v5 2/8 sunxi: add sun7i pinmux and gpio support

Quoted 4 lines · Ian Campbell

This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

Quoted 10 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/df847b2f/attachment.pgp>
#5 lore raw

PATCH v5 3/8 sunxi: add sun7i dram setup support

In reply to Ian Campbell

This patch adds DRAM initialisation support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- removed unbounded loops
- support more dram clock speeds.

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- remove redundant braces in mctl_ddr3_reset
- remove incorrect call to mctl_ddr3_reset.
- add CONFIG_SUN7I to simplify future SUN?I support.
- add a comment about the magic numbers from the a/w code dumps
- fix a bunch of checkpatch.pl issues

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 arch/arm/cpu/armv7/sunxi/Makefile      |   1 +
 arch/arm/cpu/armv7/sunxi/dram.c        | 593 +++++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-sunxi/dram.h | 179 ++++++++++
 3 files changed, 773 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/sunxi/dram.c
 create mode 100644 arch/arm/include/asm/arch-sunxi/dram.h
arch/arm/cpu/armv7/sunxi/Makefile +1 -0
index 529e7ec..d81d26c 100644
@@ -11,3 +11,4 @@ obj-y	+= timer.o
 obj-y	+= clock.o
 obj-y	+= pinmux.o
 obj-$(CONFIG_SUN7I)	+= clock_sun4i.o
+obj-$(CONFIG_SUN7I)	+= dram.o
arch/arm/cpu/armv7/sunxi/dram.c new file +593 -0

593 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/dram.h new file +179 -0

179 lines not on this page · raw message

Signature · 1 line
1.9.0
#6 lore raw

PATCH v5 3/8 sunxi: add sun7i dram setup support

Quoted 4 lines · Ian Campbell

This patch adds DRAM initialisation support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

Quoted 12 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/fc350743/attachment.pgp>
#7 lore raw

PATCH v5 4/8 sunxi: add sun7i cpu, board and start of day support

In reply to Ian Campbell

This patch adds generic board, start of day and basic build system support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- Correct SRAM_B/SRAM_D memory map

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- No changes required

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- just init dram once
- remove clock ramping until power control is implemented
- add CONFIG_SUN7I to simplify future SUN?I support.
- fix a typo

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 arch/arm/cpu/armv7/Makefile                 |   2 +-
 arch/arm/cpu/armv7/sunxi/Makefile           |  11 +++
 arch/arm/cpu/armv7/sunxi/board.c            |  88 +++++++++++++++++
 arch/arm/cpu/armv7/sunxi/cpu_info.c         |  19 ++++
 arch/arm/cpu/armv7/sunxi/start.c            |   1 +
 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds |  77 +++++++++++++++
 arch/arm/include/asm/arch-sunxi/cpu.h       | 122 ++++++++++++++++++++++++
 arch/arm/include/asm/arch-sunxi/spl.h       |  20 ++++
 board/sunxi/Makefile                        |  11 +++
 board/sunxi/board.c                         |  57 +++++++++++
 include/configs/sun7i.h                     |  24 +++++
 include/configs/sunxi-common.h              | 141 ++++++++++++++++++++++++++++
 12 files changed, 572 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/board.c
 create mode 100644 arch/arm/cpu/armv7/sunxi/cpu_info.c
 create mode 100644 arch/arm/cpu/armv7/sunxi/start.c
 create mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
 create mode 100644 arch/arm/include/asm/arch-sunxi/cpu.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/spl.h
 create mode 100644 board/sunxi/Makefile
 create mode 100644 board/sunxi/board.c
 create mode 100644 include/configs/sun7i.h
 create mode 100644 include/configs/sunxi-common.h
arch/arm/cpu/armv7/Makefile +1 -1
index 119ebb3..ddf00f3 100644
@@ -12,7 +12,7 @@ obj-y	+= cache_v7.o
 obj-y	+= cpu.o
 obj-y	+= syslib.o
 
-ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY),)
+ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y	+= lowlevel_init.o
 endif
arch/arm/cpu/armv7/sunxi/Makefile +11 -0
index d81d26c..a64bfa1 100644
@@ -8,7 +8,18 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 obj-y	+= timer.o
+obj-y	+= board.o
 obj-y	+= clock.o
 obj-y	+= pinmux.o
 obj-$(CONFIG_SUN7I)	+= clock_sun4i.o
+
+ifndef CONFIG_SPL_BUILD
+obj-y	+= cpu_info.o
+endif
+
+ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SUN7I)	+= dram.o
+ifdef CONFIG_SPL_FEL
+obj-y	+= start.o
+endif
+endif
arch/arm/cpu/armv7/sunxi/board.c new file +88 -0

88 lines not on this page · raw message

arch/arm/cpu/armv7/sunxi/cpu_info.c new file +19 -0
new file mode 100644
index 0000000..b4c3d5c
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2007-2011
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Tom Cubie <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/cpu.h>
+
+#ifdef CONFIG_DISPLAY_CPUINFO
+int print_cpuinfo(void)
+{
+	puts("CPU:   Allwinner A20 (SUN7I)\n");
+	return 0;
+}
+#endif
arch/arm/cpu/armv7/sunxi/start.c new file +1 -0
new file mode 100644
index 0000000..6b392fa
@@ -0,0 +1 @@
+/* Intentionally empty. Only needed to get FEL SPL link line right */
arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds new file +77 -0

77 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/cpu.h new file +122 -0

122 lines not on this page · raw message

arch/arm/include/asm/arch-sunxi/spl.h new file +20 -0
new file mode 100644
index 0000000..ff871bc
@@ -0,0 +1,20 @@
+/*
+ * This is a copy of omap3/spl.h:
+ *
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#ifndef	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NONE	0
+#define BOOT_DEVICE_XIP		1
+#define BOOT_DEVICE_NAND	2
+#define BOOT_DEVICE_ONE_NAND	3
+#define BOOT_DEVICE_MMC2	5 /*emmc*/
+#define BOOT_DEVICE_MMC1	6
+#define BOOT_DEVICE_XIPWAIT	7
+#define BOOT_DEVICE_MMC2_2      0xff
+#endif
board/sunxi/Makefile new file +11 -0
new file mode 100644
index 0000000..559112e
@@ -0,0 +1,11 @@
+#
+# (C) Copyright 2012 Henrik Nordstrom <[email protected]>
+#
+# Based on some other board Makefile
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+obj-y	+= board.o
board/sunxi/board.c new file +57 -0

57 lines not on this page · raw message

include/configs/sun7i.h new file +24 -0
new file mode 100644
index 0000000..9b693f7
@@ -0,0 +1,24 @@
+/*
+ * (C) Copyright 2012-2013 Henrik Nordstrom <[email protected]>
+ * (C) Copyright 2013 Luke Kenneth Casson Leighton <[email protected]>
+ *
+ * Configuration settings for the Allwinner A20 (sun7i) CPU
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * A20 specific configuration
+ */
+#define CONFIG_SUN7I		/* sun7i SoC generation */
+
+#define CONFIG_SYS_PROMPT		"sun7i# "
+
+/*
+ * Include common sunxi configuration where most the settings are
+ */
+#include <configs/sunxi-common.h>
+
+#endif /* __CONFIG_H */
include/configs/sunxi-common.h new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
1.9.0
#8 lore raw

PATCH v5 4/8 sunxi: add sun7i cpu, board and start of day support

Quoted 14 lines · Ian Campbell

This patch adds generic board, start of day and basic build system support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable.

Quoted 8 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/245c1299/attachment.pgp>
#9 lore raw

PATCH v5 5/8 sunxi: add support for Cubietruck booting in FEL mode

In reply to Ian Campbell

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- No changes required

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in.

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 board/sunxi/Makefile          |  1 +
 board/sunxi/dram_cubietruck.c | 31 +++++++++++++++++++++++++++++++
 boards.cfg                    |  1 +
 3 files changed, 33 insertions(+)
 create mode 100644 board/sunxi/dram_cubietruck.c
board/sunxi/Makefile +1 -0
index 559112e..18b1e11 100644
@@ -9,3 +9,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 obj-y	+= board.o
+obj-$(CONFIG_CUBIETRUCK)	+= dram_cubietruck.o
board/sunxi/dram_cubietruck.c new file +31 -0
new file mode 100644
index 0000000..fbcd687
@@ -0,0 +1,31 @@
+/* this file is generated, don't edit it yourself */
+
+#include <common.h>
+#include <asm/arch/dram.h>
+
+static struct dram_para dram_para = {
+	.clock = 432,
+	.type = 3,
+	.rank_num = 1,
+	.density = 4096,
+	.io_width = 8,
+	.bus_width = 32,
+	.cas = 9,
+	.zq = 0x7f,
+	.odt_en = 0,
+	.size = 2048,
+	.tpr0 = 0x42d899b7,
+	.tpr1 = 0xa090,
+	.tpr2 = 0x22a00,
+	.tpr3 = 0x0,
+	.tpr4 = 0x1,
+	.tpr5 = 0x0,
+	.emr1 = 0x4,
+	.emr2 = 0x10,
+	.emr3 = 0x0,
+};
+
+unsigned long sunxi_dram_init(void)
+{
+	return dramc_init(&dram_para);
+}
boards.cfg +1 -0
index b4203f1..31b02df 100644
@@ -371,6 +371,7 @@ Active  arm         armv7          rmobile     renesas         lager
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Mateusz Zalega <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
+Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                       sun7i:CUBIETRUCK,SPL_FEL                                                                                                          -
 Active  arm         armv7          u8500       st-ericsson     snowball            snowball                             -                                                                                                                                 Mathieu Poirier <[email protected]>
 Active  arm         armv7          u8500       st-ericsson     u8500               u8500_href                           -                                                                                                                                 -
 Active  arm         armv7          vf610       freescale       vf610twr            vf610twr                             vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg                                                                         Alison Wang <[email protected]>
Signature · 1 line
1.9.0
#10 lore raw

PATCH v5 5/8 sunxi: add support for Cubietruck booting in FEL mode

Hi Ian,

boards.cfg Active arm armv7 rmobile renesas lager · line 377

Quoted 12 lines
boards.cfg +1 -0
index b4203f1..31b02df 100644
@@ -371,6 +371,7 @@ Active  arm         armv7          rmobile     renesas         lager
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Mateusz Zalega <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
+Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                       sun7i:CUBIETRUCK,SPL_FEL                                                                                                          -
 Active  arm         armv7          u8500       st-ericsson     snowball            snowball                             -                                                                                                                                 Mathieu Poirier <[email protected]>
 Active  arm         armv7          u8500       st-ericsson     u8500               u8500_href                           -                                                                                                                                 -
 Active  arm         armv7          vf610       freescale       vf610twr            vf610twr                             vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg                                                                         Alison Wang <[email protected]>

This is a new board.
Could you fill the maintainers field (the last field of boards.cfg)?

Best Regards
Masahiro Yamada

#11 lore raw

PATCH v5 5/8 sunxi: add support for Cubietruck booting in FEL mode

Quoted 1 line · Masahiro Yamada

Could you fill the maintainers field (the last field of boards.cfg)?

Hans de Goede has a follow up series which includes this change.

Thanks,
Ian.

#12 lore raw

PATCH v5 6/8 sunxi: add gmac Ethernet support

In reply to Ian Campbell

Add support for the GMAC Ethernet controller on Allwinner A20 (sun7i) processors. Enable for the Cubietruck.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- Use correct ifdef's in and around cpu_eth_init
- Log and propagate errors from sunxi_gmac_initialize
- Move glue from drivers/net/sunxi_gmac.c to board/sunxi/gmac.c
- Remove SNTP and useless BOOTP config options.

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- drop accidentally doubled hunk
- use gpio setup functions
- moved before mmc patches

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 arch/arm/cpu/armv7/sunxi/board.c | 23 +++++++++++++++++++++++
 board/sunxi/Makefile             |  1 +
 board/sunxi/gmac.c               | 32 ++++++++++++++++++++++++++++++++
 boards.cfg                       |  2 +-
 include/configs/sunxi-common.h   | 17 +++++++++++++++++
 include/netdev.h                 |  1 +
 6 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 board/sunxi/gmac.c
arch/arm/cpu/armv7/sunxi/board.c +23 -0
index b5c0cb7..49c9448 100644
@@ -11,6 +11,8 @@
  */
 
 #include <common.h>
+#include <netdev.h>
+#include <miiphy.h>
 #include <serial.h>
 #ifdef CONFIG_SPL_BUILD
 #include <spl.h>
@@ -86,3 +88,24 @@ void enable_caches(void)
 	dcache_enable();
 }
 #endif
+
+#ifdef CONFIG_CMD_NET
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+	int rc;
+
+#ifdef CONFIG_SUNXI_GMAC
+	rc = sunxi_gmac_initialize(bis);
+	if (rc < 0) {
+		printf("sunxi: failed to initialize gmac\n");
+		return rc;
+	}
+#endif
+
+	return 0;
+}
+#endif
board/sunxi/Makefile +1 -0
index 18b1e11..cbf8f08 100644
@@ -9,4 +9,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 obj-y	+= board.o
+obj-$(CONFIG_SUNXI_GMAC)	+= gmac.o
 obj-$(CONFIG_CUBIETRUCK)	+= dram_cubietruck.o
board/sunxi/gmac.c new file +32 -0
new file mode 100644
index 0000000..e48328d
@@ -0,0 +1,32 @@
+#include <common.h>
+#include <netdev.h>
+#include <miiphy.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/gpio.h>
+
+int sunxi_gmac_initialize(bd_t *bis)
+{
+	int pin;
+	struct sunxi_ccm_reg *const ccm =
+		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+	/* Set up clock gating */
+	setbits_le32(&ccm->ahb_gate1, 0x1 << AHB_GATE_OFFSET_GMAC);
+
+	/* Set MII clock */
+	setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
+		CCM_GMAC_CTRL_GPIT_RGMII);
+
+	/* Configure pin mux settings for GMAC */
+	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
+		/* skip unused pins in RGMII mode */
+		if (pin == SUNXI_GPA(9) || pin == SUNXI_GPA(14))
+			continue;
+		sunxi_gpio_set_cfgpin(pin, SUN7I_GPA0_GMAC);
+		sunxi_gpio_set_drv(pin, 3);
+	}
+
+	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
+}
boards.cfg +1 -1
index 31b02df..b74f8c8 100644
@@ -371,7 +371,7 @@ Active  arm         armv7          rmobile     renesas         lager
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Mateusz Zalega <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
-Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                       sun7i:CUBIETRUCK,SPL_FEL                                                                                                          -
+Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                       sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII                                                                                         -
 Active  arm         armv7          u8500       st-ericsson     snowball            snowball                             -                                                                                                                                 Mathieu Poirier <[email protected]>
 Active  arm         armv7          u8500       st-ericsson     u8500               u8500_href                           -                                                                                                                                 -
 Active  arm         armv7          vf610       freescale       vf610twr            vf610twr                             vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg                                                                         Alison Wang <[email protected]>
include/configs/sunxi-common.h +17 -0
index 3f7e314..e844110 100644
@@ -127,6 +127,23 @@
 
 #define CONFIG_CONS_INDEX              1       /* UART0 */
 
+#ifdef CONFIG_SUNXI_GMAC
+#define CONFIG_DESIGNWARE_ETH		/* GMAC can use designware driver */
+#define CONFIG_DW_AUTONEG
+#define CONFIG_PHY_GIGE			/* GMAC can use gigabit PHY	*/
+#define CONFIG_PHY_ADDR		1
+#define CONFIG_MII			/* MII PHY management		*/
+#define CONFIG_PHYLIB
+#endif
+
+#ifdef CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_DNS
+#define CONFIG_NETCONSOLE
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#endif
+
 #if !defined CONFIG_ENV_IS_IN_MMC && \
     !defined CONFIG_ENV_IS_IN_NAND && \
     !defined CONFIG_ENV_IS_IN_FAT && \
include/netdev.h +1 -0
index 32b5073..fc4a2f8 100644
@@ -79,6 +79,7 @@ int sh_eth_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
 int smc91111_initialize(u8 dev_num, int base_addr);
 int smc911x_initialize(u8 dev_num, int base_addr);
+int sunxi_gmac_initialize(bd_t *bis);
 int sunxi_wemac_initialize(bd_t *bis);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_standard_init(bd_t *bis);
Signature · 1 line
1.9.0
#13 lore raw

PATCH v5 6/8 sunxi: add gmac Ethernet support

Quoted 7 lines · Ian Campbell

Add support for the GMAC Ethernet controller on Allwinner A20 (sun7i) processors. Enable for the Cubietruck.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/a15c4980/attachment.pgp>
#14 lore raw

PATCH v5 7/8 sunxi: mmc support

In reply to Ian Campbell

This adds support for the MMC controller on the Allwinner A20 (sun7i) processor.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- Moved pinmux setup from drivers/mmc/sunxi_mmc.c to board/sunxi/board.c
- Use setbits_le32 to manipulate the ahb0 gate.

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- use proper gpio interfaces, removing awkward casts and some magic numbers.
- remove magic numbers
- other cleanups

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

mmc: drop debug

---
 arch/arm/include/asm/arch-sunxi/mmc.h | 124 +++++++++
 board/sunxi/board.c                   |  72 +++++
 drivers/mmc/Makefile                  |   1 +
 drivers/mmc/sunxi_mmc.c               | 503 ++++++++++++++++++++++++++++++++++
 include/configs/sunxi-common.h        |  11 +
 5 files changed, 711 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-sunxi/mmc.h
 create mode 100644 drivers/mmc/sunxi_mmc.c
arch/arm/include/asm/arch-sunxi/mmc.h new file +124 -0
new file mode 100644
index 0000000..53196e3
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2007-2011
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Aaron <[email protected]>
+ *
+ * MMC register definition for allwinner sunxi platform.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _SUNXI_MMC_H
+#define _SUNXI_MMC_H
+
+#include <linux/types.h>
+
+struct sunxi_mmc {
+	u32 gctrl;		/* 0x00 global control */
+	u32 clkcr;		/* 0x04 clock control */
+	u32 timeout;		/* 0x08 time out */
+	u32 width;		/* 0x0c bus width */
+	u32 blksz;		/* 0x10 block size */
+	u32 bytecnt;		/* 0x14 byte count */
+	u32 cmd;		/* 0x18 command */
+	u32 arg;		/* 0x1c argument */
+	u32 resp0;		/* 0x20 response 0 */
+	u32 resp1;		/* 0x24 response 1 */
+	u32 resp2;		/* 0x28 response 2 */
+	u32 resp3;		/* 0x2c response 3 */
+	u32 imask;		/* 0x30 interrupt mask */
+	u32 mint;		/* 0x34 masked interrupt status */
+	u32 rint;		/* 0x38 raw interrupt status */
+	u32 status;		/* 0x3c status */
+	u32 ftrglevel;		/* 0x40 FIFO threshold watermark*/
+	u32 funcsel;		/* 0x44 function select */
+	u32 cbcr;		/* 0x48 CIU byte count */
+	u32 bbcr;		/* 0x4c BIU byte count */
+	u32 dbgc;		/* 0x50 debug enable */
+	u32 res0[11];
+	u32 dmac;		/* 0x80 internal DMA control */
+	u32 dlba;		/* 0x84 internal DMA descr list base address */
+	u32 idst;		/* 0x88 internal DMA status */
+	u32 idie;		/* 0x8c internal DMA interrupt enable */
+	u32 chda;		/* 0x90 */
+	u32 cbda;		/* 0x94 */
+	u32 res1[26];
+	u32 fifo;		/* 0x100 FIFO access address */
+};
+
+#define SUNXI_MMC_CLK_POWERSAVE		(0x1 << 17)
+#define SUNXI_MMC_CLK_ENABLE		(0x1 << 16)
+#define SUNXI_MMC_CLK_DIVIDER_MASK	(0xff)
+
+#define SUNXI_MMC_GCTRL_SOFT_RESET	(0x1 << 0)
+#define SUNXI_MMC_GCTRL_FIFO_RESET	(0x1 << 1)
+#define SUNXI_MMC_GCTRL_DMA_RESET	(0x1 << 2)
+#define SUNXI_MMC_GCTRL_RESET		(SUNXI_MMC_GCTRL_SOFT_RESET|\
+					 SUNXI_MMC_GCTRL_FIFO_RESET|\
+					 SUNXI_MMC_GCTRL_DMA_RESET)
+#define SUNXI_MMC_GCTRL_DMA_ENABLE	(0x1 << 5)
+#define SUNXI_MMC_GCTRL_ACCESS_BY_AHB   (0x1 << 31)
+
+#define SUNXI_MMC_CMD_RESP_EXPIRE	(0x1 << 6)
+#define SUNXI_MMC_CMD_LONG_RESPONSE	(0x1 << 7)
+#define SUNXI_MMC_CMD_CHK_RESPONSE_CRC	(0x1 << 8)
+#define SUNXI_MMC_CMD_DATA_EXPIRE	(0x1 << 9)
+#define SUNXI_MMC_CMD_WRITE		(0x1 << 10)
+#define SUNXI_MMC_CMD_AUTO_STOP		(0x1 << 12)
+#define SUNXI_MMC_CMD_WAIT_PRE_OVER	(0x1 << 13)
+#define SUNXI_MMC_CMD_SEND_INIT_SEQ	(0x1 << 15)
+#define SUNXI_MMC_CMD_UPCLK_ONLY	(0x1 << 21)
+#define SUNXI_MMC_CMD_START		(0x1 << 31)
+
+#define SUNXI_MMC_RINT_RESP_ERROR		(0x1 << 1)
+#define SUNXI_MMC_RINT_COMMAND_DONE		(0x1 << 2)
+#define SUNXI_MMC_RINT_DATA_OVER		(0x1 << 3)
+#define SUNXI_MMC_RINT_TX_DATA_REQUEST		(0x1 << 4)
+#define SUNXI_MMC_RINT_RX_DATA_REQUEST		(0x1 << 5)
+#define SUNXI_MMC_RINT_RESP_CRC_ERROR		(0x1 << 6)
+#define SUNXI_MMC_RINT_DATA_CRC_ERROR		(0x1 << 7)
+#define SUNXI_MMC_RINT_RESP_TIMEOUT		(0x1 << 8)
+#define SUNXI_MMC_RINT_DATA_TIMEOUT		(0x1 << 9)
+#define SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE	(0x1 << 10)
+#define SUNXI_MMC_RINT_FIFO_RUN_ERROR		(0x1 << 11)
+#define SUNXI_MMC_RINT_HARD_WARE_LOCKED		(0x1 << 12)
+#define SUNXI_MMC_RINT_START_BIT_ERROR		(0x1 << 13)
+#define SUNXI_MMC_RINT_AUTO_COMMAND_DONE	(0x1 << 14)
+#define SUNXI_MMC_RINT_END_BIT_ERROR		(0x1 << 15)
+#define SUNXI_MMC_RINT_SDIO_INTERRUPT		(0x1 << 16)
+#define SUNXI_MMC_RINT_CARD_INSERT		(0x1 << 30)
+#define SUNXI_MMC_RINT_CARD_REMOVE		(0x1 << 31)
+#define SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT      \
+	(SUNXI_MMC_RINT_RESP_ERROR |		\
+	 SUNXI_MMC_RINT_RESP_CRC_ERROR |	\
+	 SUNXI_MMC_RINT_DATA_CRC_ERROR |	\
+	 SUNXI_MMC_RINT_RESP_TIMEOUT |		\
+	 SUNXI_MMC_RINT_DATA_TIMEOUT |		\
+	 SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE |	\
+	 SUNXI_MMC_RINT_FIFO_RUN_ERROR |	\
+	 SUNXI_MMC_RINT_HARD_WARE_LOCKED |	\
+	 SUNXI_MMC_RINT_START_BIT_ERROR |	\
+	 SUNXI_MMC_RINT_END_BIT_ERROR) /* 0xbfc2 */
+#define SUNXI_MMC_RINT_INTERRUPT_DONE_BIT	\
+	(SUNXI_MMC_RINT_AUTO_COMMAND_DONE |	\
+	 SUNXI_MMC_RINT_DATA_OVER |		\
+	 SUNXI_MMC_RINT_COMMAND_DONE |		\
+	 SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE)
+
+#define SUNXI_MMC_STATUS_RXWL_FLAG		(0x1 << 0)
+#define SUNXI_MMC_STATUS_TXWL_FLAG		(0x1 << 1)
+#define SUNXI_MMC_STATUS_FIFO_EMPTY		(0x1 << 2)
+#define SUNXI_MMC_STATUS_FIFO_FULL		(0x1 << 3)
+#define SUNXI_MMC_STATUS_CARD_PRESENT		(0x1 << 8)
+#define SUNXI_MMC_STATUS_CARD_DATA_BUSY		(0x1 << 9)
+#define SUNXI_MMC_STATUS_DATA_FSM_BUSY		(0x1 << 10)
+
+#define SUNXI_MMC_IDMAC_RESET		(0x1 << 0)
+#define SUNXI_MMC_IDMAC_FIXBURST	(0x1 << 1)
+#define SUNXI_MMC_IDMAC_ENABLE		(0x1 << 7)
+
+#define SUNXI_MMC_IDIE_TXIRQ		(0x1 << 0)
+#define SUNXI_MMC_IDIE_RXIRQ		(0x1 << 1)
+
+int sunxi_mmc_init(int sdc_no);
+#endif /* _SUNXI_MMC_H */
board/sunxi/board.c +72 -0

84 lines not on this page · raw message

drivers/mmc/Makefile +1 -0
index 931922b..5e67098 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
 obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
 obj-$(CONFIG_DWMMC) += dw_mmc.o
 obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
+obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
 obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
 obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
 ifdef CONFIG_SPL_BUILD
drivers/mmc/sunxi_mmc.c new file +503 -0

503 lines not on this page · raw message

include/configs/sunxi-common.h +11 -0
index e844110..4253452 100644
@@ -59,6 +59,16 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
 
+/* mmc config */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_MMC_SUNXI
+#define CONFIG_MMC_SUNXI_SLOT		0
+#define CONFIG_MMC_SUNXI_USE_DMA
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0	/* first detected MMC controller */
+
 /* 4MB of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (4 << 20))
 
@@ -94,6 +104,7 @@
 #define CONFIG_SYS_MONITOR_LEN		(512 << 10)	/* 512 KiB */
 #define CONFIG_IDENT_STRING		" Allwinner Technology"
 
+#define CONFIG_ENV_OFFSET		(544 << 10) /* (8 + 24 + 512) KiB */
 #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
Signature · 1 line
1.9.0
#15 lore raw

PATCH v5 7/8 sunxi: mmc support

Quoted 13 lines · Ian Campbell

This adds support for the MMC controller on the Allwinner A20 (sun7i) processor.

Ian, thanks a lot for your endurance and patience to get this sunxi stuff upstream. Really appreciated. One comment below:

<snip>

Quoted 38 lines
board/sunxi/board.c +23 -0
index 328334a..dc7f636 100644
@@ -14,6 +14,8 @@
  #include <common.h>
  #include <asm/arch/clock.h>
  #include <asm/arch/dram.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc.h>
 
  DECLARE_GLOBAL_DATA_PTR;
 
@@ -43,6 +45,76 @@ int dram_init(void)
  	return 0;
  }
 
+#ifdef CONFIG_GENERIC_MMC
+static void mmc_pinmux_setup(int sdc)
+{
+	unsigned int pin;
+
+	switch (sdc) {
+	case 0:
+		/* D1-PF0, D0-PF1, CLK-PF2, CMD-PF3, D3-PF4, D4-PF5 */
+		for (pin = SUNXI_GPF(0); pin <= SUNXI_GPF(5); pin++) {
+			sunxi_gpio_set_cfgpin(pin, SUNXI_GPF0_SDC0);
+			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
+			sunxi_gpio_set_drv(pin, 2);
+		}
+		break;
+
+	case 1:
+#if CONFIG_MMC1_PG
+		/* PG0-CMD, PG1-CLK, PG2~5-D0~3 : 4 */
+		for (pin = SUNXI_GPG(0); pin <= SUNXI_GPG(5); pin++) {
+			sunxi_gpio_set_cfgpin(pin, SUN4I_GPG0_SDC1);
+			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);

board/sunxi/board.c int dram_init(void) · line 78

Quoted 10 lines
board/sunxi/board.c +10 -0
+			sunxi_gpio_set_drv(pin, 2);
+		}
+#else
+		/* PH22-CMD, PH23-CLK, PH24~27-D0~D3 : 5 */
+		for (pin = SUNXI_GPH(22); pin <= SUNXI_GPH(27); pin++) {
+			sunxi_gpio_set_cfgpin(pin, SUN4I_GPH22_SDC1);
+			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
+			sunxi_gpio_set_drv(pin, 2);
+		}
+#endif

Are you sure that this is correct and shouldn't be:

+#ifdef CONFIG_MMC1_PG

?

A quick scan through this patch series shows that this define is not set at all. Perhaps its outdated? Or is it used to support some other sunxi SoC? Not sure, perhaps it should be removed for now.

Other than this please add my:

Thanks,
Stefan

#16 lore raw

PATCH v5 7/8 sunxi: mmc support

Quoted 8 lines · Stefan Roese

board/sunxi/board.c int dram_init(void) · line 64

Quoted 2 lines
board/sunxi/board.c +2 -0
+	case 1:
+#if CONFIG_MMC1_PG

Are you sure that this is correct and shouldn't be:

+#ifdef CONFIG_MMC1_PG

?

It's "correct" in so far as it works (the boards.cfg config stuff #defines things to 1), but I think you are right that it isn't the preferred style. But...

Quoted 4 lines

A quick scan through this patch series shows that this define is not set at all. Perhaps its outdated? Or is it used to support some other sunxi SoC? Not sure, perhaps it should be removed for now.

...I had thought that it was to support some other board which wasn't being upstreamed right now, so eventually useful and harmless for now, but I've just checked and it isn't actually used by any of the boards in u-boot-sunxi.git. So rather than fix it to use #ifdef lets drop it. Rather than resend the entire series, here is v5.1 of this patch.

Quoted 3 lines

Other than this please add my:

Thanks!

8<---------------------------------

#17 lore raw

PATCH v5 7/8 sunxi: mmc support

On Mon, May 05, 2014 at 02:42:31PM +0100, Ian Campbell wrote:
[snip]

Quoted 8 lines

From 20704e35a41664de5f516ed0e02981ac06085102 Mon Sep 17 00:00:00 2001
From: Ian Campbell <[email protected]>
Date: Fri, 7 Mar 2014 04:29:39 +0000
Subject: [PATCH v5.1 7/8] sunxi: mmc support

This adds support for the MMC controller on the Allwinner A20 (sun7i) processor.

Quoted 10 lines
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/f07e4725/attachment.pgp>
#18 lore raw

PATCH v5 8/8 sunxi: non-FEL SPL boot support for sun7i

In reply to Ian Campbell

Add support for booting from an MMC card.

---
v5: Based on 3f5ff92b1503 "sunxi: add comments to pll1_para array."
- No changes required

v4: Based on d9fe0a1e061e "sunxi: mksunxiboot: remove unnecessary casts."
- fixed in mksunxiboot.c
- use stdint.h types
- drop unused code
- fix the types to avoid casting and potential misalignments

v3: Based on c89867dca2e9 "sunxi: clocks: clock_get_pll5 prototype and coding style".

v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c "sunxi: mmc:
checkpatch whitespace fixes" with v2014.04-rc2 merged in:
- mksunxiboot cleanups
- rebase on Kbuild stuff

v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 "arm: Handle .gnu.hash section in ldscripts" vs v2014.01.

---
 Makefile                                |  10 +++
 arch/arm/cpu/armv7/sunxi/config.mk      |   8 ++
 arch/arm/cpu/armv7/sunxi/u-boot-spl.lds |  52 ++++++++++++
 boards.cfg                              |   1 +
 include/configs/sunxi-common.h          |  26 ++++++
 spl/Makefile                            |  13 +++
 tools/.gitignore                        |   1 +
 tools/Makefile                          |   2 +
 tools/mksunxiboot.c                     | 142 ++++++++++++++++++++++++++++++++
 9 files changed, 255 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
 create mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
 create mode 100644 tools/mksunxiboot.c
Makefile +10 -0
index c91c10e..379731c 100644
@@ -870,6 +870,13 @@ OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
 u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 	$(call if_changed,pad_cat)
 
+ifneq ($(CONFIG_SUNXI),)
+OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
+				   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
+	$(call if_changed,pad_cat)
+endif
+
 ifneq ($(CONFIG_TEGRA),)
 OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
 u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
@@ -1081,6 +1088,9 @@ spl/u-boot-spl.bin: spl/u-boot-spl
 spl/u-boot-spl: tools prepare
 	$(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
 
+spl/sunxi-spl.bin: spl/u-boot-spl
+	@:
+
 tpl/u-boot-tpl.bin: tools prepare
 	$(Q)$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
 
arch/arm/cpu/armv7/sunxi/config.mk new file +8 -0
new file mode 100644
index 0000000..00f5ffc
@@ -0,0 +1,8 @@
+# Build a combined spl + u-boot image
+ifdef CONFIG_SPL
+ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_SPL_FEL
+ALL-y += u-boot-sunxi-with-spl.bin
+endif
+endif
+endif
arch/arm/cpu/armv7/sunxi/u-boot-spl.lds new file +52 -0

52 lines not on this page · raw message

boards.cfg +1 -0
index b74f8c8..b6e20ae 100644
@@ -371,6 +371,7 @@ Active  arm         armv7          rmobile     renesas         lager
 Active  arm         armv7          s5pc1xx     samsung         goni                s5p_goni                             -                                                                                                                                 Mateusz Zalega <[email protected]>
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                             -                                                                                                                                 Minkyu Kang <[email protected]>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                     -                                                                                                                                 -
+Active  arm         armv7          sunxi       -               sunxi               Cubietruck                           sun7i:CUBIETRUCK,SPL,SUNXI_GMAC,RGMII                                                                                             -
 Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                       sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII                                                                                         -
 Active  arm         armv7          u8500       st-ericsson     snowball            snowball                             -                                                                                                                                 Mathieu Poirier <[email protected]>
 Active  arm         armv7          u8500       st-ericsson     u8500               u8500_href                           -                                                                                                                                 -
include/configs/sunxi-common.h +26 -0
index 4253452..5d72d62 100644
@@ -17,6 +17,11 @@
  * High Level Configuration Options
  */
 #define CONFIG_SUNXI		/* sunxi family */
+#ifdef CONFIG_SPL_BUILD
+#ifndef CONFIG_SPL_FEL
+#define CONFIG_SYS_THUMB_BUILD	/* Thumbs mode to save space in SPL */
+#endif
+#endif
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 
@@ -121,11 +126,32 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 
+#ifdef CONFIG_SPL_FEL
+
 #define CONFIG_SPL
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds"
 #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/armv7/sunxi"
 #define CONFIG_SPL_TEXT_BASE		0x2000
 #define CONFIG_SPL_MAX_SIZE		0x4000		/* 16 KiB */
+
+#else /* CONFIG_SPL */
+
+#define CONFIG_SPL_BSS_START_ADDR	0x4ff80000
+#define CONFIG_SPL_BSS_MAX_SIZE		0x80000		/* 512 KiB */
+
+#define CONFIG_SPL_TEXT_BASE		0x20		/* sram start+header */
+#define CONFIG_SPL_MAX_SIZE		0x5fe0		/* 24KB on sun4i/sun7i */
+
+#define CONFIG_SPL_LIBDISK_SUPPORT
+#define CONFIG_SPL_MMC_SUPPORT
+
+#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds"
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	80	/* 40KiB */
+#define CONFIG_SPL_PAD_TO		32768		/* decimal for 'dd' */
+
+#endif /* CONFIG_SPL */
+
 /* end of 32 KiB in sram */
 #define LOW_LEVEL_SRAM_STACK		0x00008000 /* End of sram */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
spl/Makefile +13 -0
index 6fec252..e7c7a95 100644
@@ -188,6 +188,12 @@ ifdef CONFIG_SAMSUNG
 ALL-y	+= $(obj)/$(BOARD)-spl.bin
 endif
 
+ifdef CONFIG_SUNXI
+ifndef CONFIG_SPL_FEL
+ALL-y	+= $(obj)/sunxi-spl.bin
+endif
+endif
+
 all:	$(ALL-y)
 
 ifdef CONFIG_SAMSUNG
@@ -215,6 +221,13 @@ ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
+ifdef CONFIG_SUNXI
+quiet_cmd_mksunxiboot = MKSUNXI $@
+cmd_mksunxiboot = $(objtree)/tools/mksunxiboot $< $@
+$(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin
+	$(call if_changed,mksunxiboot)
+endif
+
 quiet_cmd_u-boot-spl = LD      $@
       cmd_u-boot-spl = cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
 		       $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
tools/.gitignore +1 -0
index 2a90dfe..3ad5db3 100644
@@ -9,6 +9,7 @@
 /mkexynosspl
 /mpc86x_clk
 /mxsboot
+/mksunxiboot
 /ncb
 /proftool
 /relocate-rela
tools/Makefile +2 -0
index 097cc1d..062a404 100644
@@ -120,6 +120,8 @@ hostprogs-$(CONFIG_MX23) += mxsboot$(SFX)
 hostprogs-$(CONFIG_MX28) += mxsboot$(SFX)
 HOSTCFLAGS_mxsboot$(SFX).o := -pedantic
 
+hostprogs-$(CONFIG_SUNXI) += mksunxiboot$(SFX)
+
 hostprogs-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
 
tools/mksunxiboot.c new file +142 -0

142 lines not on this page · raw message

Signature · 1 line
1.9.0
#19 lore raw

PATCH v5 8/8 sunxi: non-FEL SPL boot support for sun7i

Quoted 7 lines · Ian Campbell

Add support for booting from an MMC card.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/ba9eba5c/attachment.pgp>
#20 lore raw

PATCH v5 8/8 sunxi: non-FEL SPL boot support for sun7i

Quoted 11 lines · Tom Rini
Quoted 7 lines · Ian Campbell

Add support for booting from an MMC card.

I think that makes a full set of reviews from you, thank you!

Ian.

#21 lore raw

PATCH v5 8/8 sunxi: non-FEL SPL boot support for sun7i

Quoted 11 lines · Ian Campbell
Quoted 10 lines · Tom Rini
Quoted 7 lines · Ian Campbell

Add support for booting from an MMC card.

Quoted 3 lines
Quoted 1 line

I think that makes a full set of reviews from you, thank you!

Yup. Thanks for porting all of this over!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140509/bd5b72ae/attachment.pgp>
#22 lore raw

v5 cover sunxi: initial upstreaming effort

In reply to Ian Campbell
Quoted 8 lines · Ian Campbell

This is my fifth attempt at an upstreamable series based upon the
https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet.

Quoted 4 lines

The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e 3f5ff92b1503 "sunxi: add comments to pll1_para array." and applies to u-boot v2014.04. It merges cleanly into current mainline head.

I'm fine here. Tom/Albert, can you do one last skim over them and apply if OK?

Thanks!

Best regards,
Marek Vasut

#23 lore raw

v5 cover sunxi: initial upstreaming effort

In reply to Ian Campbell

Hi Ian,

Quoted 82 lines · Ian Campbell

This is my fifth attempt at an upstreamable series based upon the
https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet.

The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e 3f5ff92b1503 "sunxi: add comments to pll1_para array." and applies to u-boot v2014.04. It merges cleanly into current mainline head.

As of v4 the majority of the series now has at least one Ack or Reviewed-by. In summary:

  +  sunxi: add sun7i clocks and timer support.
mT   sunxi: add sun7i pinmux and gpio support
M    sunxi: add sun7i dram setup support
M +  sunxi: add sun7i cpu, board and start of day support
MT   sunxi: add support for Cubietruck booting in FEL mode
M    sunxi: add gmac Ethernet support
M    sunxi: mmc support
M    sunxi: non-FEL SPL boot support for sun7i

M==Reviewed-by Marek Vasut.
m==Acked-by Marek Vasut.
T==Reviewed-by Tom Rini
+==Minor changes in v5

Changes in v5:
- Resynced with u-boot-sunxi.git 3f5ff92b1503 "sunxi: add comments to pll1_para array.". Dropped "Reduce DMA burst length" patch which is being handled elsewhere. Otherwise see individual commit logs for details.

Changes in v4:
- Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments.

Global changes in v3:
- Rebased onto v2014.04 and resynced with u-boot-sunxi.git c89867dca2e9
- Improved commit messages
- Updated lists of contributors
- Added some CCs
- Lots of cleanup based on review comments.

Global changes in v2:
- Use SPDX-License-Identifier
- Resync with u-boot-sunxi.git
- Lot of updates to the individual patches, see the individual commit messages (checkpatch.pl fixes, magic number removal etc).
- Pulled the Ethernet stuff before the MMC and non-FEL boot stuff. The MMC stuff (which non-FEL boot needs) still needs some more cleanup, but the reordering means that the initial part of the series could in principal go in.

This series can also be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5

There is no SMP here, since that relies on the PSCI support from Marc Zyngier which has yet to land in mainline. Marc has recently rebased and a version based on this series can be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5-smp

I've tried to give corect credit and S-o-b based upon:
git log --pretty='%aN' linux-sunxi/sunxi -- [PATHS] | sort -u git log linux-sunxi/sunxi -- [PATHS] | grep -i signed.off.by | sort -u Manual inspection

This will tend to over credit, since it will include folks who contributed code which has since been removed as well as those who contributed code which is not included in this patch set, but I think it is better to be conservative and include too many rather than incorrectly exclude people. Doing better than this would be IMHO too hard to be worth it (e.g. git blame would prefer a recent whitespace cleanup to the actual author of the code and prefer someone did code motion over the original author, so it would be a massive & manual process).

Quoted 3 lines

[0] https://github.com/linux-sunxi/u-boot-sunxi.git

Applied (with manual fixes to minor 'git am' conflicts on ./boards.cfg and ./Makefile) to u-boot-arm/master, thanks!

(now, to try and understand once more if and how this could be leveraged for A31 support...)

Amicalement,

Signature · 1 line
Albert.
#24 lore raw

v5 cover sunxi: initial upstreaming effort

On Sunday, May 25, 2014 at 05:02:57 PM, Albert ARIBAUD wrote:

[...]

Quoted 10 lines
Quoted 10 lines

This will tend to over credit, since it will include folks who contributed code which has since been removed as well as those who contributed code which is not included in this patch set, but I think it is better to be conservative and include too many rather than incorrectly exclude people. Doing better than this would be IMHO too hard to be worth it (e.g. git blame would prefer a recent whitespace cleanup to the actual author of the code and prefer someone did code motion over the original author, so it would be a massive & manual process).

Quoted 4 lines
Quoted 1 line

[0] https://github.com/linux-sunxi/u-boot-sunxi.git

Applied (with manual fixes to minor 'git am' conflicts on ./boards.cfg and ./Makefile) to u-boot-arm/master, thanks!

Thank you all for the effort. It's really nice to see we did it.

Quoted 2 lines

(now, to try and understand once more if and how this could be leveraged for A31 support...)

I suppose it'll be much easier to add new stuff now that we have the groundwork in :)

Best regards,
Marek Vasut

#25 lore raw

v5 cover sunxi: initial upstreaming effort

In reply to Albert ARIBAUD
Quoted 2 lines · Albert ARIBAUD

Applied (with manual fixes to minor 'git am' conflicts on ./boards.cfg and ./Makefile) to u-boot-arm/master, thanks!

Thank you!

Quoted 2 lines

(now, to try and understand once more if and how this could be leveraged for A31 support...)

I've not been involved with the A31 stuff myself (yet?) but having a baseline in mainline will surely be helpful.

Ian,

#26 lore raw

v5 cover sunxi: initial upstreaming effort

In reply to Albert ARIBAUD
Quoted 5 lines · Albert ARIBAUD

Applied (with manual fixes to minor 'git am' conflicts on ./boards.cfg and ./Makefile) to u-boot-arm/master, thanks!

(now, to try and understand once more if and how this could be leveraged for A31 support...)

Hans and I have some patches for the A31. Unfortunately, we haven't figured out the DRAM initialization, so it's second-stage-only at the moment.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140525/eb4dadaf/attachment.pgp>
#27 lore raw

v5 cover sunxi: initial upstreaming effort

In reply to Albert ARIBAUD

Hi,

Quoted 87 lines · Albert ARIBAUD

Hi Ian,

Quoted 82 lines · Ian Campbell

This is my fifth attempt at an upstreamable series based upon the
https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet.

The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e 3f5ff92b1503 "sunxi: add comments to pll1_para array." and applies to u-boot v2014.04. It merges cleanly into current mainline head.

As of v4 the majority of the series now has at least one Ack or Reviewed-by. In summary:

  +  sunxi: add sun7i clocks and timer support.
mT   sunxi: add sun7i pinmux and gpio support
M    sunxi: add sun7i dram setup support
M +  sunxi: add sun7i cpu, board and start of day support
MT   sunxi: add support for Cubietruck booting in FEL mode
M    sunxi: add gmac Ethernet support
M    sunxi: mmc support
M    sunxi: non-FEL SPL boot support for sun7i

M==Reviewed-by Marek Vasut.
m==Acked-by Marek Vasut.
T==Reviewed-by Tom Rini
+==Minor changes in v5

Changes in v5:
- Resynced with u-boot-sunxi.git 3f5ff92b1503 "sunxi: add comments to pll1_para array.". Dropped "Reduce DMA burst length" patch which is being handled elsewhere. Otherwise see individual commit logs for details.

Changes in v4:
- Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments.

Global changes in v3:
- Rebased onto v2014.04 and resynced with u-boot-sunxi.git c89867dca2e9
- Improved commit messages
- Updated lists of contributors
- Added some CCs
- Lots of cleanup based on review comments.

Global changes in v2:
- Use SPDX-License-Identifier
- Resync with u-boot-sunxi.git
- Lot of updates to the individual patches, see the individual commit messages (checkpatch.pl fixes, magic number removal etc).
- Pulled the Ethernet stuff before the MMC and non-FEL boot stuff. The MMC stuff (which non-FEL boot needs) still needs some more cleanup, but the reordering means that the initial part of the series could in principal go in.

This series can also be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5

There is no SMP here, since that relies on the PSCI support from Marc Zyngier which has yet to land in mainline. Marc has recently rebased and a version based on this series can be found at:

git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v5-smp

I've tried to give corect credit and S-o-b based upon:
git log --pretty='%aN' linux-sunxi/sunxi -- [PATHS] | sort -u git log linux-sunxi/sunxi -- [PATHS] | grep -i signed.off.by | sort -u Manual inspection

This will tend to over credit, since it will include folks who contributed code which has since been removed as well as those who contributed code which is not included in this patch set, but I think it is better to be conservative and include too many rather than incorrectly exclude people. Doing better than this would be IMHO too hard to be worth it (e.g. git blame would prefer a recent whitespace cleanup to the actual author of the code and prefer someone did code motion over the original author, so it would be a massive & manual process).

Quoted 6 lines
Quoted 3 lines

[0] https://github.com/linux-sunxi/u-boot-sunxi.git

Applied (with manual fixes to minor 'git am' conflicts on ./boards.cfg and ./Makefile) to u-boot-arm/master, thanks!

Thank you too. I'm really happy to see this getting into u-boot proper. Beginner question, since this does not touch existing code, will it still go into the 2014.07 release ?

Quoted 2 lines

(now, to try and understand once more if and how this could be leveraged for A31 support...)

I've been working on a patch-series for adding sun4i and sun5i support, which has been almost done for 2 weeks now, seeing Ian's part of this effort merged surely motivates me to finish that work quickly :)

sun6i (aka A31) support unfortunately is a different story, once I've the sun4i / sun5i support series finished, I can relatively easy also give you a 2nd series adding the sun6i support which we have in the u-boot-sunxi git repository (the need for which will hopefully go away completely soon). But this support is incomplete, it needs allwinners boot0 and boot1 binaries to boot-strap u-boot, since we don't have dram setup code yet. With these binaries you should be able to be able to ie boot a Linux kernel with this u-boot, but it is not a standalone solution. Let me know if you're interested in receiving a series with this (incomplete) support.

I've given a friend of mine an mele A1000G quad to work on the dram setup code, I'll ping him on this.

Regards,

Hans