public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support
@ 2015-05-20 13:35 Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33 Hans de Goede
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

Hi Ian,

Here is the long awaited version 2 of my Allwinner A80 support series.

Changes since v2:
-Cleaned up the sunxi-common.h #ifdef-ery to deal with the DRAM base
 differences
-Added a patch for the base address of the A1 SRAM being different, using
 the proper base address  allows removal of the mis-use of save_boot_params
 to book a SYS_CTRL register really early during boot
-Added 2 new misc. preparation patches

Regards,

Hans

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  2015-05-21 19:03   ` Ian Campbell
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries Hans de Goede
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

Unlike the A31 and the A23 the A33 actually has a SID inside the SoC again,
but sid[3] is 0 (at least on some SoCs), so it is better to use the axp221
sid.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/arm/cpu/armv7/sunxi/cpu_info.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c
index 30ec4ac..8e8c84f 100644
--- a/arch/arm/cpu/armv7/sunxi/cpu_info.c
+++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c
@@ -78,18 +78,16 @@ int print_cpuinfo(void)
 
 int sunxi_get_sid(unsigned int *sid)
 {
-#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I_A23
 #ifdef CONFIG_AXP221_POWER
 	return axp221_get_sid(sid);
-#else
-	return -ENODEV;
-#endif
-#else
+#elif defined SUNXI_SID_BASE
 	int i;
 
 	for (i = 0; i< 4; i++)
 		sid[i] = readl(SUNXI_SID_BASE + 4 * i);
 
 	return 0;
+#else
+	return -ENODEV;
 #endif
 }
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33 Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  2015-05-21 19:04   ` Ian Campbell
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i Hans de Goede
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

The latest versions of the fel tool support loading normal u-boot builds
directly, and this is now the preferred way to use the fel boot method.

This commit removes support for the old deprecated standalone fel builds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/arm/cpu/armv7/sunxi/board.c |  8 --------
 board/sunxi/Kconfig              | 16 ----------------
 include/configs/sunxi-common.h   |  9 ---------
 3 files changed, 33 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index e6730c0..75ce7b5 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -120,13 +120,6 @@ void s_init(void)
  */
 u32 spl_boot_device(void)
 {
-#ifdef CONFIG_SPL_FEL
-	/*
-	 * This is the legacy compile time configuration for a special FEL
-	 * enabled build. It has many restrictions and can only boot over USB.
-	 */
-	return BOOT_DEVICE_BOARD;
-#else
 	/*
 	 * When booting from the SD card, the "eGON.BT0" signature is expected
 	 * to be found in memory at the address 0x0004 (see the "mksunxiboot"
@@ -147,7 +140,6 @@ u32 spl_boot_device(void)
 		return BOOT_DEVICE_MMC1;
 	else
 		return BOOT_DEVICE_BOARD;
-#endif
 }
 
 /* No confirmation data available in SPL yet. Hardcode bootmode */
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index a6bbf6e..ca805e4 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -194,24 +194,8 @@ config SYS_BOARD
 config SYS_SOC
 	default "sunxi"
 
-config SPL_FEL
-	bool "SPL/FEL mode support"
-	depends on SPL
-	default n
-	help
-	  This enables support for Fast Early Loader (FEL) mode. This
-	  allows U-Boot to be loaded to the board over USB by the on-chip
-	  boot rom. U-Boot should be sent in two parts: SPL first, with
-	  'fel write 0x2000 u-boot-spl.bin; fel exe 0x2000' then U-Boot with
-	  'fel write 0x4a000000 u-boot.bin; fel exe 0x4a000000'. This option
-	  shrinks the amount of SRAM available to SPL, so only enable it if
-	  you need FEL. Note that enabling this option only allows FEL to be
-	  used; it is still possible to boot U-Boot from boot media. U-Boot
-	  SPL detects when it is being loaded using FEL.
-
 config UART0_PORT_F
 	bool "UART0 on MicroSD breakout board"
-	depends on SPL_FEL
 	default n
 	---help---
 	Repurpose the SD card slot for getting access to the UART0 serial
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index d829899..5dd2480 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -162,13 +162,6 @@
 
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
 
-#ifdef CONFIG_SPL_FEL
-
-#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 */
 
@@ -186,8 +179,6 @@
 #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
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33 Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  2015-05-21 19:05   ` Ian Campbell
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM " Hans de Goede
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

The DRAM Base differs between sun9i and the others, update sunxi-common.h to
deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/configs/sunxi-common.h | 53 ++++++++++++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 18 deletions(-)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 5dd2480..2b90681 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -13,6 +13,8 @@
 #ifndef _SUNXI_COMMON_CONFIG_H
 #define _SUNXI_COMMON_CONFIG_H
 
+#include <linux/stringify.h>
+
 #ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
 /*
  * The U-Boot workarounds bugs in the outdated buggy sunxi-3.4 kernels at the
@@ -39,8 +41,6 @@
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 
-#define CONFIG_SYS_TEXT_BASE		0x4a000000
-
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM_SERIAL)
 # define CONFIG_DW_SERIAL
 #endif
@@ -69,8 +69,34 @@
 /* CPU */
 #define CONFIG_SYS_CACHELINE_SIZE	64
 
-/* DRAM Base */
+/*
+ * The DRAM Base differs between some models. We cannot use macros for the
+ * CONFIG_FOO defines which contain the DRAM base address since they end
+ * up unexpanded in include/autoconf.mk .
+ *
+ * So we have to have this #ifdef #else #endif block for these.
+ */
+#ifdef CONFIG_MACH_SUN9I
+#define SDRAM_OFFSET(x) 0x2##x
+#define CONFIG_SYS_SDRAM_BASE		0x20000000
+#define CONFIG_SYS_LOAD_ADDR		0x22000000 /* default load address */
+#define CONFIG_SYS_TEXT_BASE		0x2a000000
+#define CONFIG_PRE_CON_BUF_ADDR		0x2f000000
+#define CONFIG_SYS_SPL_MALLOC_START	0x2ff00000
+#define CONFIG_SPL_BSS_START_ADDR	0x2ff80000
+#else
+#define SDRAM_OFFSET(x) 0x4##x
 #define CONFIG_SYS_SDRAM_BASE		0x40000000
+#define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */
+#define CONFIG_SYS_TEXT_BASE		0x4a000000
+#define CONFIG_PRE_CON_BUF_ADDR		0x4f000000
+#define CONFIG_SYS_SPL_MALLOC_START	0x4ff00000
+#define CONFIG_SPL_BSS_START_ADDR	0x4ff80000
+#endif
+
+#define CONFIG_SPL_BSS_MAX_SIZE		0x00080000 /* 512 KiB */
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000 /* 512 KiB */
+
 #define CONFIG_SYS_INIT_RAM_ADDR	0x0
 #define CONFIG_SYS_INIT_RAM_SIZE	0x8000	/* 32 KiB */
 
@@ -129,10 +155,8 @@
 /* Boot Argument Buffer Size */
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
 
-#define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */
-
 /* standalone support */
-#define CONFIG_STANDALONE_LOAD_ADDR	0x42000000
+#define CONFIG_STANDALONE_LOAD_ADDR	CONFIG_SYS_LOAD_ADDR
 
 /* baudrate */
 #define CONFIG_BAUDRATE			115200
@@ -162,9 +186,6 @@
 
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
 
-#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 */
 
@@ -182,8 +203,6 @@
 /* end of 32 KiB in sram */
 #define LOW_LEVEL_SRAM_STACK		0x00008000 /* End of sram */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
-#define CONFIG_SYS_SPL_MALLOC_START	0x4ff00000
-#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000	/* 512 KiB */
 
 /* I2C */
 #if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER
@@ -333,8 +352,6 @@ extern int soft_i2c_gpio_scl;
 /* Enable pre-console buffer to get complete log on the VGA console */
 #define CONFIG_PRE_CONSOLE_BUFFER
 #define CONFIG_PRE_CON_BUF_SZ		4096 /* Aprox 2 80*25 screens */
-/* Use the room between the end of bootm_size and the framebuffer */
-#define CONFIG_PRE_CON_BUF_ADDR		0x4f000000
 
 /*
  * 240M RAM (256M minimum minus space for the framebuffer),
@@ -343,11 +360,11 @@ extern int soft_i2c_gpio_scl;
  */
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"bootm_size=0xf000000\0" \
-	"kernel_addr_r=0x42000000\0" \
-	"fdt_addr_r=0x43000000\0" \
-	"scriptaddr=0x43100000\0" \
-	"pxefile_addr_r=0x43200000\0" \
-	"ramdisk_addr_r=0x43300000\0"
+	"kernel_addr_r=" __stringify(SDRAM_OFFSET(2000000)) "\0" \
+	"fdt_addr_r=" __stringify(SDRAM_OFFSET(3000000)) "\0" \
+	"scriptaddr=" __stringify(SDRAM_OFFSET(3100000)) "\0" \
+	"pxefile_addr_r=" __stringify(SDRAM_OFFSET(3200000)) "\0" \
+	"ramdisk_addr_r=" __stringify(SDRAM_OFFSET(3300000)) "\0"
 
 #ifdef CONFIG_MMC
 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
                   ` (2 preceding siblings ...)
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  2015-05-21 19:07   ` Ian Campbell
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 5/6] sun9i: Basic sun9i (A80) support Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 6/6] sun9i: Add Merrii_A80_Optimus board / defconfig file Hans de Goede
  5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
to deal with this, so that we do not set the initial stack pointer to point
to the BROM.

This removes the need for the weird undocumented register write I took from
the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
needed to be done really early on.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/configs/sunxi-common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 2b90681..76f42f5 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -97,8 +97,20 @@
 #define CONFIG_SPL_BSS_MAX_SIZE		0x00080000 /* 512 KiB */
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000 /* 512 KiB */
 
+#ifdef CONFIG_MACH_SUN9I
+/*
+ * The A80's A1 sram starts at 0x00010000 rather then at 0x00000000 and is
+ * slightly bigger. Note that it is possible to map the first 32 KiB of the
+ * A1 at 0x00000000 like with older SoCs by writing 0x16aa0001 to the
+ * undocumented 0x008000e0 SYS_CTRL register. Where the 16aa is a key and
+ * the 1 actually activates the mapping of the first 32 KiB to 0x00000000.
+ */
+#define CONFIG_SYS_INIT_RAM_ADDR	0x10000
+#define CONFIG_SYS_INIT_RAM_SIZE	0x0a000	/* 40 KiB */
+#else
 #define CONFIG_SYS_INIT_RAM_ADDR	0x0
 #define CONFIG_SYS_INIT_RAM_SIZE	0x8000	/* 32 KiB */
+#endif
 
 #define CONFIG_SYS_INIT_SP_OFFSET \
 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 5/6] sun9i: Basic sun9i (A80) support
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
                   ` (3 preceding siblings ...)
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM " Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 6/6] sun9i: Add Merrii_A80_Optimus board / defconfig file Hans de Goede
  5 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

Add initial sun9i (A80) support, only uart + mmc are supported for now.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
 arch/arm/cpu/armv7/sunxi/Makefile      |  2 ++
 arch/arm/cpu/armv7/sunxi/board.c       |  4 ++++
 arch/arm/cpu/armv7/sunxi/cpu_info.c    |  3 +++
 arch/arm/include/asm/arch-sunxi/gpio.h |  1 +
 board/sunxi/Kconfig                    |  6 ++++++
 board/sunxi/board.c                    |  3 ++-
 include/configs/sun9i.h                | 21 +++++++++++++++++++++
 7 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 include/configs/sun9i.h

diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile
index 6a0299f..7ef6b4c 100644
--- a/arch/arm/cpu/armv7/sunxi/Makefile
+++ b/arch/arm/cpu/armv7/sunxi/Makefile
@@ -13,7 +13,9 @@ obj-y	+= clock.o
 obj-y	+= cpu_info.o
 obj-y	+= dram_helpers.o
 obj-y	+= pinmux.o
+ifndef CONFIG_MACH_SUN9I
 obj-y	+= usb_phy.o
+endif
 obj-$(CONFIG_MACH_SUN6I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN8I)	+= prcm.o
 obj-$(CONFIG_MACH_SUN9I)	+= prcm.o
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 75ce7b5..23aa249 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -64,6 +64,10 @@ static int gpio_init(void)
 	sunxi_gpio_set_cfgpin(SUNXI_GPH(20), SUN6I_GPH_UART0);
 	sunxi_gpio_set_cfgpin(SUNXI_GPH(21), SUN6I_GPH_UART0);
 	sunxi_gpio_set_pull(SUNXI_GPH(21), SUNXI_GPIO_PULL_UP);
+#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN9I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(12), SUN9I_GPH_UART0);
+	sunxi_gpio_set_cfgpin(SUNXI_GPH(13), SUN9I_GPH_UART0);
+	sunxi_gpio_set_pull(SUNXI_GPH(13), SUNXI_GPIO_PULL_UP);
 #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
 	sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1);
 	sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1);
diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c
index 8e8c84f..a276fad 100644
--- a/arch/arm/cpu/armv7/sunxi/cpu_info.c
+++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c
@@ -11,6 +11,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 #include <axp221.h>
+#include <errno.h>
 
 #ifdef CONFIG_MACH_SUN6I
 int sunxi_get_ss_bonding_id(void)
@@ -68,6 +69,8 @@ int print_cpuinfo(void)
 	puts("CPU:   Allwinner A23 (SUN8I)\n");
 #elif defined CONFIG_MACH_SUN8I_A33
 	puts("CPU:   Allwinner A33 (SUN8I)\n");
+#elif defined CONFIG_MACH_SUN9I
+	puts("CPU:   Allwinner A80 (SUN9I)\n");
 #else
 #warning Please update cpu_info.c with correct CPU information
 	puts("CPU:   SUNXI Family\n");
diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
index 148123a..496295d 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -185,6 +185,7 @@ enum sunxi_gpio_number {
 #define SUN8I_GPH_TWI1		2
 #define SUN6I_GPH_TWI2		2
 #define SUN6I_GPH_UART0		2
+#define SUN9I_GPH_UART0		2
 
 #define SUNXI_GPI_SDC3		2
 #define SUN7I_GPI_TWI3		3
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index ca805e4..6f5fde9 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -59,6 +59,11 @@ config MACH_SUN8I_A33
 	select SUNXI_GEN_SUN6I
 	select SUPPORT_SPL
 
+config MACH_SUN9I
+	bool "sun9i (Allwinner A80)"
+	select CPU_V7
+	select SUNXI_GEN_SUN6I
+
 endchoice
 
 # The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33"
@@ -187,6 +192,7 @@ config SYS_CONFIG_NAME
 	default "sun6i" if MACH_SUN6I
 	default "sun7i" if MACH_SUN7I
 	default "sun8i" if MACH_SUN8I
+	default "sun9i" if MACH_SUN9I
 
 config SYS_BOARD
 	default "sunxi"
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 5f79cc1..ed60e74 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -530,10 +530,11 @@ int misc_init_r(void)
 		}
 	}
 
+#ifndef CONFIG_MACH_SUN9I
 	ret = sunxi_usb_phy_probe();
 	if (ret)
 		return ret;
-
+#endif
 #if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
 	musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
 #endif
diff --git a/include/configs/sun9i.h b/include/configs/sun9i.h
new file mode 100644
index 0000000..cd9e08d
--- /dev/null
+++ b/include/configs/sun9i.h
@@ -0,0 +1,21 @@
+/*
+ * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * Configuration settings for the Allwinner A80 (sun9i) CPU
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * A80 specific configuration
+ */
+
+/*
+ * Include common sunxi configuration where most the settings are
+ */
+#include <configs/sunxi-common.h>
+
+#endif /* __CONFIG_H */
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 6/6] sun9i: Add Merrii_A80_Optimus board / defconfig file
  2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
                   ` (4 preceding siblings ...)
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 5/6] sun9i: Basic sun9i (A80) support Hans de Goede
@ 2015-05-20 13:35 ` Hans de Goede
  5 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2015-05-20 13:35 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
 board/sunxi/MAINTAINERS              |  2 ++
 configs/Merrii_A80_Optimus_defconfig | 11 +++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 configs/Merrii_A80_Optimus_defconfig

diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index a650554..22d560a 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -40,6 +40,8 @@ F:	include/configs/sun8i.h
 F:	configs/ga10h_v1_1_defconfig
 F:	configs/Ippo_q8h_v1_2_defconfig
 F:	configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
+F:	include/configs/sun9i.h
+F:	configs/Merrii_A80_Optimus_defconfig
 
 A20-OLINUXINO-LIME BOARD
 M:	FUKAUMI Naoki <naobsd@gmail.com>
diff --git a/configs/Merrii_A80_Optimus_defconfig b/configs/Merrii_A80_Optimus_defconfig
new file mode 100644
index 0000000..6bd5273
--- /dev/null
+++ b/configs/Merrii_A80_Optimus_defconfig
@@ -0,0 +1,11 @@
+CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-optimus"
+CONFIG_VIDEO=n
+CONFIG_USB_KEYBOARD=n
+CONFIG_MMC0_CD_PIN="PH18"
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN9I=y
+# these are unused atm but we must set them to something
+CONFIG_DRAM_CLK=360
+CONFIG_DRAM_ZQ=123
+CONFIG_SYS_CLK_FREQ=1008000000
-- 
2.4.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33 Hans de Goede
@ 2015-05-21 19:03   ` Ian Campbell
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Campbell @ 2015-05-21 19:03 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> Unlike the A31 and the A23 the A33 actually has a SID inside the SoC again,
> but sid[3] is 0 (at least on some SoCs), so it is better to use the axp221
> sid.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries Hans de Goede
@ 2015-05-21 19:04   ` Ian Campbell
  2015-05-22 14:55     ` Hans de Goede
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Campbell @ 2015-05-21 19:04 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> The latest versions of the fel tool support loading normal u-boot builds
> directly, and this is now the preferred way to use the fel boot method.

Has sunxi-tools with that actually been released? I don't think so, we
should probably prod $whoever to release a v1.3

Regardless, I think we can move on...

> This commit removes support for the old deprecated standalone fel builds.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i Hans de Goede
@ 2015-05-21 19:05   ` Ian Campbell
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Campbell @ 2015-05-21 19:05 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> The DRAM Base differs between sun9i and the others, update sunxi-common.h to
> deal with this.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i
  2015-05-20 13:35 ` [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM " Hans de Goede
@ 2015-05-21 19:07   ` Ian Campbell
  2015-05-21 22:27     ` Hans de Goede
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Campbell @ 2015-05-21 19:07 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
> to deal with this, so that we do not set the initial stack pointer to point
> to the BROM.
> 
> This removes the need for the weird undocumented register write I took from
> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
> needed to be done really early on.

(typo: "allwinner")

Removes in the sense that it simply no longer appears in the series, I
think? (As opposed to a removal hunk being missing from this or a
subsequent patch)

Assuming that is the case:

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i
  2015-05-21 19:07   ` Ian Campbell
@ 2015-05-21 22:27     ` Hans de Goede
  2015-05-22  6:32       ` Ian Campbell
  0 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2015-05-21 22:27 UTC (permalink / raw)
  To: u-boot

Hi,

On 21-05-15 21:07, Ian Campbell wrote:
> On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
>> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
>> to deal with this, so that we do not set the initial stack pointer to point
>> to the BROM.
>>
>> This removes the need for the weird undocumented register write I took from
>> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
>> needed to be done really early on.
>
> (typo: "allwinner")
>
> Removes in the sense that it simply no longer appears in the series, I
> think? (As opposed to a removal hunk being missing from this or a
> subsequent patch)

Correct, remove as in simply no longer appears in the series.

Regsrds,

Hans

>
> Assuming that is the case:
>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Ian Campbell <ijc@hellion.org.uk>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i
  2015-05-21 22:27     ` Hans de Goede
@ 2015-05-22  6:32       ` Ian Campbell
  2015-05-22 14:58         ` Hans de Goede
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Campbell @ 2015-05-22  6:32 UTC (permalink / raw)
  To: u-boot

On Fri, 2015-05-22 at 00:27 +0200, Hans de Goede wrote:
> Hi,
> 
> On 21-05-15 21:07, Ian Campbell wrote:
> > On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> >> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
> >> to deal with this, so that we do not set the initial stack pointer to point
> >> to the BROM.
> >>
> >> This removes the need for the weird undocumented register write I took from
> >> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
> >> needed to be done really early on.
> >
> > (typo: "allwinner")
> >
> > Removes in the sense that it simply no longer appears in the series, I
> > think? (As opposed to a removal hunk being missing from this or a
> > subsequent patch)
> 
> Correct, remove as in simply no longer appears in the series.

Perhaps s/removes/avoids/ and s/write I took/write I previously took/ to
clarify?

Ack regardless.

> 
> Regsrds,
> 
> Hans
> 
> >
> > Assuming that is the case:
> >
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >
> > Acked-by: Ian Campbell <ijc@hellion.org.uk>
> >
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries
  2015-05-21 19:04   ` Ian Campbell
@ 2015-05-22 14:55     ` Hans de Goede
  0 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2015-05-22 14:55 UTC (permalink / raw)
  To: u-boot

Hi,

On 21-05-15 21:04, Ian Campbell wrote:
> On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
>> The latest versions of the fel tool support loading normal u-boot builds
>> directly, and this is now the preferred way to use the fel boot method.
>
> Has sunxi-tools with that actually been released? I don't think so, we
> should probably prod $whoever to release a v1.3

I thought that Sairhei was going to do a release with the new "fel spl"
support. Sairhei?

Regards,

Hans

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i
  2015-05-22  6:32       ` Ian Campbell
@ 2015-05-22 14:58         ` Hans de Goede
  0 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2015-05-22 14:58 UTC (permalink / raw)
  To: u-boot

Hi,

On 22-05-15 08:32, Ian Campbell wrote:
> On Fri, 2015-05-22 at 00:27 +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 21-05-15 21:07, Ian Campbell wrote:
>>> On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
>>>> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
>>>> to deal with this, so that we do not set the initial stack pointer to point
>>>> to the BROM.
>>>>
>>>> This removes the need for the weird undocumented register write I took from
>>>> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
>>>> needed to be done really early on.
>>>
>>> (typo: "allwinner")
>>>
>>> Removes in the sense that it simply no longer appears in the series, I
>>> think? (As opposed to a removal hunk being missing from this or a
>>> subsequent patch)
>>
>> Correct, remove as in simply no longer appears in the series.
>
> Perhaps s/removes/avoids/ and s/write I took/write I previously took/ to
> clarify?

Updated the commit msg with the above suggestion.

Thanks & Regards,

Hans

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-05-22 14:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 13:35 [U-Boot] [PATCH v2 0/6] sunxi: Allwinner A80 SoC support Hans de Goede
2015-05-20 13:35 ` [U-Boot] [PATCH v2 1/6] sunxi: Use axp221 sid on a33 Hans de Goede
2015-05-21 19:03   ` Ian Campbell
2015-05-20 13:35 ` [U-Boot] [PATCH v2 2/6] sunxi: Remove support for building "old-fashioned" fel binaries Hans de Goede
2015-05-21 19:04   ` Ian Campbell
2015-05-22 14:55     ` Hans de Goede
2015-05-20 13:35 ` [U-Boot] [PATCH v2 3/6] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i Hans de Goede
2015-05-21 19:05   ` Ian Campbell
2015-05-20 13:35 ` [U-Boot] [PATCH v2 4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM " Hans de Goede
2015-05-21 19:07   ` Ian Campbell
2015-05-21 22:27     ` Hans de Goede
2015-05-22  6:32       ` Ian Campbell
2015-05-22 14:58         ` Hans de Goede
2015-05-20 13:35 ` [U-Boot] [PATCH v2 5/6] sun9i: Basic sun9i (A80) support Hans de Goede
2015-05-20 13:35 ` [U-Boot] [PATCH v2 6/6] sun9i: Add Merrii_A80_Optimus board / defconfig file Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox