sunxi: add basic V3s support
Basic U-Boot support is now present for V3s. Some memory addresses are changed specially for V3s, as the original address map cannot fit into a so small DRAM. As the DRAM controller code needs a big refactor, the SPL support is disabled in this version. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
This commit is contained in:
		
							parent
							
								
									1ae5def6be
								
							
						
					
					
						commit
						c199489f17
					
				|  | @ -161,6 +161,7 @@ enum sunxi_gpio_number { | ||||||
| #define SUN8I_GPB_UART2		2 | #define SUN8I_GPB_UART2		2 | ||||||
| #define SUN8I_A33_GPB_UART0	3 | #define SUN8I_A33_GPB_UART0	3 | ||||||
| #define SUN8I_A83T_GPB_UART0	2 | #define SUN8I_A83T_GPB_UART0	2 | ||||||
|  | #define SUN8I_V3S_GPB_UART0	3 | ||||||
| #define SUN50I_GPB_UART0	4 | #define SUN50I_GPB_UART0	4 | ||||||
| 
 | 
 | ||||||
| #define SUNXI_GPC_NAND		2 | #define SUNXI_GPC_NAND		2 | ||||||
|  |  | ||||||
|  | @ -114,6 +114,10 @@ static int gpio_init(void) | ||||||
| 	sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_A83T_GPB_UART0); | 	sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_A83T_GPB_UART0); | ||||||
| 	sunxi_gpio_set_cfgpin(SUNXI_GPB(10), SUN8I_A83T_GPB_UART0); | 	sunxi_gpio_set_cfgpin(SUNXI_GPB(10), SUN8I_A83T_GPB_UART0); | ||||||
| 	sunxi_gpio_set_pull(SUNXI_GPB(10), SUNXI_GPIO_PULL_UP); | 	sunxi_gpio_set_pull(SUNXI_GPB(10), SUNXI_GPIO_PULL_UP); | ||||||
|  | #elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN8I_V3S) | ||||||
|  | 	sunxi_gpio_set_cfgpin(SUNXI_GPB(8), SUN8I_V3S_GPB_UART0); | ||||||
|  | 	sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_V3S_GPB_UART0); | ||||||
|  | 	sunxi_gpio_set_pull(SUNXI_GPB(9), SUNXI_GPIO_PULL_UP); | ||||||
| #elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN9I) | #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(12), SUN9I_GPH_UART0); | ||||||
| 	sunxi_gpio_set_cfgpin(SUNXI_GPH(13), SUN9I_GPH_UART0); | 	sunxi_gpio_set_cfgpin(SUNXI_GPH(13), SUN9I_GPH_UART0); | ||||||
|  |  | ||||||
|  | @ -89,6 +89,8 @@ int print_cpuinfo(void) | ||||||
| 	printf("CPU:   Allwinner H3 (SUN8I %04x)\n", sunxi_get_sram_id()); | 	printf("CPU:   Allwinner H3 (SUN8I %04x)\n", sunxi_get_sram_id()); | ||||||
| #elif defined CONFIG_MACH_SUN8I_R40 | #elif defined CONFIG_MACH_SUN8I_R40 | ||||||
| 	printf("CPU:   Allwinner R40 (SUN8I %04x)\n", sunxi_get_sram_id()); | 	printf("CPU:   Allwinner R40 (SUN8I %04x)\n", sunxi_get_sram_id()); | ||||||
|  | #elif defined CONFIG_MACH_SUN8I_V3S | ||||||
|  | 	printf("CPU:   Allwinner V3s (SUN8I %04x)\n", sunxi_get_sram_id()); | ||||||
| #elif defined CONFIG_MACH_SUN9I | #elif defined CONFIG_MACH_SUN9I | ||||||
| 	puts("CPU:   Allwinner A80 (SUN9I)\n"); | 	puts("CPU:   Allwinner A80 (SUN9I)\n"); | ||||||
| #elif defined CONFIG_MACH_SUN50I | #elif defined CONFIG_MACH_SUN50I | ||||||
|  |  | ||||||
|  | @ -144,6 +144,15 @@ config MACH_SUN8I_R40 | ||||||
| 	select SUNXI_GEN_SUN6I | 	select SUNXI_GEN_SUN6I | ||||||
| 	select SUPPORT_SPL | 	select SUPPORT_SPL | ||||||
| 
 | 
 | ||||||
|  | config MACH_SUN8I_V3S | ||||||
|  | 	bool "sun8i (Allwinner V3s)" | ||||||
|  | 	select CPU_V7 | ||||||
|  | 	select CPU_V7_HAS_NONSEC | ||||||
|  | 	select CPU_V7_HAS_VIRT | ||||||
|  | 	select ARCH_SUPPORT_PSCI | ||||||
|  | 	select SUNXI_GEN_SUN6I | ||||||
|  | 	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT | ||||||
|  | 
 | ||||||
| config MACH_SUN9I | config MACH_SUN9I | ||||||
| 	bool "sun9i (Allwinner A80)" | 	bool "sun9i (Allwinner A80)" | ||||||
| 	select CPU_V7 | 	select CPU_V7 | ||||||
|  | @ -175,6 +184,7 @@ config MACH_SUN8I | ||||||
| 	default y if MACH_SUN8I_A83T | 	default y if MACH_SUN8I_A83T | ||||||
| 	default y if MACH_SUNXI_H3_H5 | 	default y if MACH_SUNXI_H3_H5 | ||||||
| 	default y if MACH_SUN8I_R40 | 	default y if MACH_SUN8I_R40 | ||||||
|  | 	default y if MACH_SUN8I_V3S | ||||||
| 
 | 
 | ||||||
| config RESERVE_ALLWINNER_BOOT0_HEADER | config RESERVE_ALLWINNER_BOOT0_HEADER | ||||||
| 	bool "reserve space for Allwinner boot0 header" | 	bool "reserve space for Allwinner boot0 header" | ||||||
|  | @ -544,6 +554,7 @@ config VIDEO | ||||||
| 	depends on !MACH_SUN8I_A83T | 	depends on !MACH_SUN8I_A83T | ||||||
| 	depends on !MACH_SUNXI_H3_H5 | 	depends on !MACH_SUNXI_H3_H5 | ||||||
| 	depends on !MACH_SUN8I_R40 | 	depends on !MACH_SUN8I_R40 | ||||||
|  | 	depends on !MACH_SUN8I_V3S | ||||||
| 	depends on !MACH_SUN9I | 	depends on !MACH_SUN9I | ||||||
| 	depends on !MACH_SUN50I | 	depends on !MACH_SUN50I | ||||||
| 	default y | 	default y | ||||||
|  |  | ||||||
|  | @ -21,6 +21,8 @@ | ||||||
| 	#define CONFIG_SUNXI_USB_PHYS	4 | 	#define CONFIG_SUNXI_USB_PHYS	4 | ||||||
| #elif defined CONFIG_MACH_SUN8I_A83T | #elif defined CONFIG_MACH_SUN8I_A83T | ||||||
| 	#define CONFIG_SUNXI_USB_PHYS	3 | 	#define CONFIG_SUNXI_USB_PHYS	3 | ||||||
|  | #elif defined CONFIG_MACH_SUN8I_V3S | ||||||
|  | 	#define CONFIG_SUNXI_USB_PHYS	1 | ||||||
| #else | #else | ||||||
| 	#define CONFIG_SUNXI_USB_PHYS	2 | 	#define CONFIG_SUNXI_USB_PHYS	2 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -69,7 +69,12 @@ | ||||||
| #define SDRAM_OFFSET(x) 0x4##x | #define SDRAM_OFFSET(x) 0x4##x | ||||||
| #define CONFIG_SYS_SDRAM_BASE		0x40000000 | #define CONFIG_SYS_SDRAM_BASE		0x40000000 | ||||||
| #define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */ | #define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */ | ||||||
|  | /* V3s do not have enough memory to place code at 0x4a000000 */ | ||||||
|  | #ifndef CONFIG_MACH_SUN8I_V3S | ||||||
| #define CONFIG_SYS_TEXT_BASE		0x4a000000 | #define CONFIG_SYS_TEXT_BASE		0x4a000000 | ||||||
|  | #else | ||||||
|  | #define CONFIG_SYS_TEXT_BASE		0x42e00000 | ||||||
|  | #endif | ||||||
| /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
 | /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
 | ||||||
|  * since it needs to fit in with the other values. By also #defining it |  * since it needs to fit in with the other values. By also #defining it | ||||||
|  * we get warnings if the Kconfig value mismatches. */ |  * we get warnings if the Kconfig value mismatches. */ | ||||||
|  | @ -146,8 +151,13 @@ | ||||||
| #define CONFIG_ENV_SIZE			(128 << 10) | #define CONFIG_ENV_SIZE			(128 << 10) | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | #ifndef CONFIG_MACH_SUN8I_V3S | ||||||
| /* 64MB of malloc() pool */ | /* 64MB of malloc() pool */ | ||||||
| #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (64 << 20)) | #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (64 << 20)) | ||||||
|  | #else | ||||||
|  | /* 2MB of malloc() pool */ | ||||||
|  | #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (2 << 20)) | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * Miscellaneous configurable options |  * Miscellaneous configurable options | ||||||
|  | @ -340,6 +350,7 @@ extern int soft_i2c_gpio_scl; | ||||||
|  * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd. |  * Scripts, PXE and DTBs should go afterwards, leaving the rest for the initrd. | ||||||
|  * Align the initrd to a 2MB page. |  * Align the initrd to a 2MB page. | ||||||
|  */ |  */ | ||||||
|  | #define BOOTM_SIZE	__stringify(0xa000000) | ||||||
| #define KERNEL_ADDR_R	__stringify(SDRAM_OFFSET(0080000)) | #define KERNEL_ADDR_R	__stringify(SDRAM_OFFSET(0080000)) | ||||||
| #define FDT_ADDR_R	__stringify(SDRAM_OFFSET(FA00000)) | #define FDT_ADDR_R	__stringify(SDRAM_OFFSET(FA00000)) | ||||||
| #define SCRIPT_ADDR_R	__stringify(SDRAM_OFFSET(FC00000)) | #define SCRIPT_ADDR_R	__stringify(SDRAM_OFFSET(FC00000)) | ||||||
|  | @ -352,16 +363,30 @@ extern int soft_i2c_gpio_scl; | ||||||
|  * 32M uncompressed kernel, 16M compressed kernel, 1M fdt, |  * 32M uncompressed kernel, 16M compressed kernel, 1M fdt, | ||||||
|  * 1M script, 1M pxe and the ramdisk at the end. |  * 1M script, 1M pxe and the ramdisk at the end. | ||||||
|  */ |  */ | ||||||
| 
 | #ifndef CONFIG_MACH_SUN8I_V3S | ||||||
|  | #define BOOTM_SIZE     __stringify(0xa000000) | ||||||
| #define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(2000000)) | #define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(2000000)) | ||||||
| #define FDT_ADDR_R     __stringify(SDRAM_OFFSET(3000000)) | #define FDT_ADDR_R     __stringify(SDRAM_OFFSET(3000000)) | ||||||
| #define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(3100000)) | #define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(3100000)) | ||||||
| #define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000)) | #define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000)) | ||||||
| #define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000)) | #define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000)) | ||||||
|  | #else | ||||||
|  | /*
 | ||||||
|  |  * 64M RAM minus 2MB heap + 16MB for u-boot, stack, fb, etc. | ||||||
|  |  * 16M uncompressed kernel, 8M compressed kernel, 1M fdt, | ||||||
|  |  * 1M script, 1M pxe and the ramdisk at the end. | ||||||
|  |  */ | ||||||
|  | #define BOOTM_SIZE     __stringify(0x2e00000) | ||||||
|  | #define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(1000000)) | ||||||
|  | #define FDT_ADDR_R     __stringify(SDRAM_OFFSET(1800000)) | ||||||
|  | #define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(1900000)) | ||||||
|  | #define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(1A00000)) | ||||||
|  | #define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(1B00000)) | ||||||
|  | #endif | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #define MEM_LAYOUT_ENV_SETTINGS \ | #define MEM_LAYOUT_ENV_SETTINGS \ | ||||||
| 	"bootm_size=0xa000000\0" \ | 	"bootm_size=" BOOTM_SIZE "\0" \ | ||||||
| 	"kernel_addr_r=" KERNEL_ADDR_R "\0" \ | 	"kernel_addr_r=" KERNEL_ADDR_R "\0" \ | ||||||
| 	"fdt_addr_r=" FDT_ADDR_R "\0" \ | 	"fdt_addr_r=" FDT_ADDR_R "\0" \ | ||||||
| 	"scriptaddr=" SCRIPT_ADDR_R "\0" \ | 	"scriptaddr=" SCRIPT_ADDR_R "\0" \ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue