diff options
author | Tom Rini | 2017-06-29 15:28:51 -0400 |
---|---|---|
committer | Tom Rini | 2017-06-29 15:28:51 -0400 |
commit | f42f25dad80688886b4e0b12b8e75c86c4d350e7 (patch) | |
tree | 6a09cbb34ea3d25119ee3085327273dac6c42004 | |
parent | e3f40720bac263c00b5f78777fa948775ed1330f (diff) | |
parent | 67482f57e6127d7d3e216dae6860dac7b33132d5 (diff) |
Merge git://git.denx.de/u-boot-arc
-rw-r--r-- | arch/arc/Kconfig | 4 | ||||
-rw-r--r-- | arch/arc/dts/Makefile | 1 | ||||
-rw-r--r-- | arch/arc/dts/hsdk.dts | 50 | ||||
-rw-r--r-- | arch/arc/lib/cache.c | 29 | ||||
-rw-r--r-- | arch/arc/lib/start.S | 4 | ||||
-rw-r--r-- | board/synopsys/hsdk/Kconfig | 12 | ||||
-rw-r--r-- | board/synopsys/hsdk/MAINTAINERS | 5 | ||||
-rw-r--r-- | board/synopsys/hsdk/Makefile | 7 | ||||
-rw-r--r-- | board/synopsys/hsdk/hsdk.c | 74 | ||||
-rw-r--r-- | configs/axs101_defconfig | 5 | ||||
-rw-r--r-- | configs/axs103_defconfig | 4 | ||||
-rw-r--r-- | configs/hsdk_defconfig | 37 | ||||
-rw-r--r-- | include/configs/axs10x.h | 36 | ||||
-rw-r--r-- | include/configs/hsdk.h | 93 | ||||
-rw-r--r-- | include/configs/nsim.h | 1 | ||||
-rw-r--r-- | include/configs/tb100.h | 1 |
16 files changed, 325 insertions, 38 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 6e4b1d0e229..e3f9db7b297 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -132,10 +132,14 @@ config TARGET_AXS101 config TARGET_AXS103 bool "Support Synopsys Designware SDP board AXS103" +config TARGET_HSDK + bool "Support Synpsys HS DevelopmentKit board" + endchoice source "board/abilis/tb100/Kconfig" source "board/synopsys/Kconfig" source "board/synopsys/axs10x/Kconfig" +source "board/synopsys/hsdk/Kconfig" endmenu diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile index 218a6475dd5..63a66947128 100644 --- a/arch/arc/dts/Makefile +++ b/arch/arc/dts/Makefile @@ -6,6 +6,7 @@ dtb-$(CONFIG_TARGET_AXS101) += axs101.dtb dtb-$(CONFIG_TARGET_AXS103) += axs103.dtb dtb-$(CONFIG_TARGET_NSIM) += nsim.dtb dtb-$(CONFIG_TARGET_TB100) += abilis_tb100.dtb +dtb-$(CONFIG_TARGET_HSDK) += hsdk.dtb targets += $(dtb-y) diff --git a/arch/arc/dts/hsdk.dts b/arch/arc/dts/hsdk.dts new file mode 100644 index 00000000000..a7b276c01eb --- /dev/null +++ b/arch/arc/dts/hsdk.dts @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2017 Synopsys, Inc. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ +/dts-v1/; + +#include "skeleton.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + aliases { + console = &uart0; + }; + + cpu_card { + core_clk: core_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <1000000000>; + u-boot,dm-pre-reloc; + }; + }; + + uart0: serial0@f0005000 { + compatible = "snps,dw-apb-uart"; + reg = <0xf0005000 0x1000>; + reg-shift = <2>; + reg-io-width = <4>; + }; + + ethernet@f0008000 { + #interrupt-cells = <1>; + compatible = "altr,socfpga-stmmac"; + reg = <0xf0008000 0x2000>; + phy-mode = "gmii"; + }; + + ehci@0xf0040000 { + compatible = "generic-ehci"; + reg = <0xf0040000 0x100>; + }; + + ohci@0xf0060000 { + compatible = "generic-ohci"; + reg = <0xf0060000 0x100>; + }; +}; diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c index f1436bf1999..cbae27e9fce 100644 --- a/arch/arc/lib/cache.c +++ b/arch/arc/lib/cache.c @@ -8,6 +8,7 @@ #include <common.h> #include <linux/compiler.h> #include <linux/kernel.h> +#include <linux/log2.h> #include <asm/arcregs.h> #include <asm/cache.h> @@ -215,17 +216,33 @@ void cache_init(void) read_decode_cache_bcr_arcv2(); if (ioc_exists) { + /* IOC Aperture start is equal to DDR start */ + unsigned int ap_base = CONFIG_SYS_SDRAM_BASE; + /* IOC Aperture size is equal to DDR size */ + long ap_size = CONFIG_SYS_SDRAM_SIZE; + flush_dcache_all(); invalidate_dcache_all(); - /* IO coherency base - 0x8z */ - write_aux_reg(ARC_AUX_IO_COH_AP0_BASE, 0x80000); - /* IO coherency aperture size - 512Mb: 0x8z-0xAz */ - write_aux_reg(ARC_AUX_IO_COH_AP0_SIZE, 0x11); - /* Enable partial writes */ + if (!is_power_of_2(ap_size) || ap_size < 4096) + panic("IOC Aperture size must be power of 2 and bigger 4Kib"); + + /* + * IOC Aperture size decoded as 2 ^ (SIZE + 2) KB, + * so setting 0x11 implies 512M, 0x12 implies 1G... + */ + write_aux_reg(ARC_AUX_IO_COH_AP0_SIZE, + order_base_2(ap_size/1024) - 2); + + + /* IOC Aperture start must be aligned to the size of the aperture */ + if (ap_base % ap_size != 0) + panic("IOC Aperture start must be aligned to the size of the aperture"); + + write_aux_reg(ARC_AUX_IO_COH_AP0_BASE, ap_base >> 12); write_aux_reg(ARC_AUX_IO_COH_PARTIAL, 1); - /* Enable IO coherency */ write_aux_reg(ARC_AUX_IO_COH_ENABLE, 1); + } #endif } diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S index b2ba7683097..95d64f9d437 100644 --- a/arch/arc/lib/start.S +++ b/arch/arc/lib/start.S @@ -10,6 +10,9 @@ #include <asm/arcregs.h> ENTRY(_start) +; ARCompact devices are not supposed to be SMP so master/slave check +; makes no sense. +#ifdef CONFIG_ISA_ARCV2 ; Non-masters will be halted immediately, they might be kicked later ; by platform code right before passing control to the Linux kernel ; in bootm.c:boot_jump_linux(). @@ -25,6 +28,7 @@ ENTRY(_start) nop .Lmaster_proceed: +#endif /* Setup interrupt vector base that matches "__text_start" */ sr __ivt_start, [ARC_AUX_INTR_VEC_BASE] diff --git a/board/synopsys/hsdk/Kconfig b/board/synopsys/hsdk/Kconfig new file mode 100644 index 00000000000..e8c00a6e7d0 --- /dev/null +++ b/board/synopsys/hsdk/Kconfig @@ -0,0 +1,12 @@ +if TARGET_HSDK + +config SYS_BOARD + default "hsdk" + +config SYS_VENDOR + default "synopsys" + +config SYS_CONFIG_NAME + default "hsdk" + +endif diff --git a/board/synopsys/hsdk/MAINTAINERS b/board/synopsys/hsdk/MAINTAINERS new file mode 100644 index 00000000000..d034bc479d0 --- /dev/null +++ b/board/synopsys/hsdk/MAINTAINERS @@ -0,0 +1,5 @@ +AXS10X BOARD +M: Alexey Brodkin <abrodkin@synopsys.com> +S: Maintained +F: board/synopsys/hsdk/ +F: configs/hsdk_defconfig diff --git a/board/synopsys/hsdk/Makefile b/board/synopsys/hsdk/Makefile new file mode 100644 index 00000000000..d84dd032652 --- /dev/null +++ b/board/synopsys/hsdk/Makefile @@ -0,0 +1,7 @@ +# +# Copyright (C) 2017 Synopsys, Inc. All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += hsdk.o diff --git a/board/synopsys/hsdk/hsdk.c b/board/synopsys/hsdk/hsdk.c new file mode 100644 index 00000000000..7b562556e6b --- /dev/null +++ b/board/synopsys/hsdk/hsdk.c @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2017 Synopsys, Inc. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dwmmc.h> +#include <malloc.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define CREG_BASE (ARC_PERIPHERAL_BASE + 0x1000) +#define CREG_PAE (CREG_BASE + 0x180) +#define CREG_PAE_UPDATE (CREG_BASE + 0x194) +#define CREG_CPU_START (CREG_BASE + 0x400) + +int board_early_init_f(void) +{ + /* In current chip PAE support for DMA is broken, disabling it. */ + writel(0, (void __iomem *) CREG_PAE); + + /* Really apply settings made above */ + writel(1, (void __iomem *) CREG_PAE_UPDATE); + + return 0; +} + +int board_mmc_init(bd_t *bis) +{ + struct dwmci_host *host = NULL; + + host = malloc(sizeof(struct dwmci_host)); + if (!host) { + printf("dwmci_host malloc fail!\n"); + return 1; + } + + memset(host, 0, sizeof(struct dwmci_host)); + host->name = "Synopsys Mobile storage"; + host->ioaddr = (void *)ARC_DWMMC_BASE; + host->buswidth = 4; + host->dev_index = 0; + host->bus_hz = 100000000; + + add_dwmci(host, host->bus_hz / 2, 400000); + + return 0; +} + +#define RESET_VECTOR_ADDR 0x0 + +void smp_set_core_boot_addr(unsigned long addr, int corenr) +{ + /* All cores have reset vector pointing to 0 */ + writel(addr, (void __iomem *)RESET_VECTOR_ADDR); + + /* Make sure other cores see written value in memory */ + flush_dcache_all(); +} + +void smp_kick_all_cpus(void) +{ +#define BITS_START_CORE1 1 +#define BITS_START_CORE2 2 +#define BITS_START_CORE3 3 + + int cmd = readl((void __iomem *)CREG_CPU_START); + + cmd |= (1 << BITS_START_CORE1) | + (1 << BITS_START_CORE2) | + (1 << BITS_START_CORE3); + writel(cmd, (void __iomem *)CREG_CPU_START); +} diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig index 1af505d9ebc..0b156524934 100644 --- a/configs/axs101_defconfig +++ b/configs/axs101_defconfig @@ -1,5 +1,4 @@ CONFIG_ARC=y -CONFIG_SYS_DCACHE_OFF=y CONFIG_TARGET_AXS101=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=750000000 @@ -14,12 +13,14 @@ CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y -CONFIG_SYS_I2C_DW=y CONFIG_MMC=y CONFIG_MMC_DW=y CONFIG_DM_ETH=y diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig index fb8e72ff6c9..add24cfe229 100644 --- a/configs/axs103_defconfig +++ b/configs/axs103_defconfig @@ -13,12 +13,14 @@ CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y -CONFIG_SYS_I2C_DW=y CONFIG_MMC=y CONFIG_MMC_DW=y CONFIG_DM_ETH=y diff --git a/configs/hsdk_defconfig b/configs/hsdk_defconfig new file mode 100644 index 00000000000..0018c0482e0 --- /dev/null +++ b/configs/hsdk_defconfig @@ -0,0 +1,37 @@ +CONFIG_ARC=y +CONFIG_ISA_ARCV2=y +CONFIG_TARGET_HSDK=y +CONFIG_SYS_TEXT_BASE=0x81000000 +CONFIG_SYS_CLK_FREQ=1000000000 +CONFIG_DEFAULT_DEVICE_TREE="hsdk" +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_SYS_PROMPT="hsdk# " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y +CONFIG_OF_EMBED=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DM=y +CONFIG_MMC=y +CONFIG_MMC_DW=y +CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_GENERIC=y +CONFIG_USB_STORAGE=y +CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h index 66e8cd5e9a4..908b0188009 100644 --- a/include/configs/axs10x.h +++ b/include/configs/axs10x.h @@ -52,32 +52,6 @@ #define CONFIG_SYS_NS16550_MEM32 /* - * I2C configuration - */ -#define CONFIG_SYS_I2C -#define CONFIG_I2C_ENV_EEPROM_BUS 2 -#define CONFIG_SYS_I2C_SPEED 100000 -#define CONFIG_SYS_I2C_SPEED1 100000 -#define CONFIG_SYS_I2C_SPEED2 100000 -#define CONFIG_SYS_I2C_SLAVE 0 -#define CONFIG_SYS_I2C_SLAVE1 0 -#define CONFIG_SYS_I2C_SLAVE2 0 -#define CONFIG_SYS_I2C_BASE 0xE001D000 -#define CONFIG_SYS_I2C_BASE1 0xE001E000 -#define CONFIG_SYS_I2C_BASE2 0xE001F000 -#define CONFIG_SYS_I2C_BUS_MAX 3 -#define IC_CLK 50 - -/* - * EEPROM configuration - */ -#define CONFIG_SYS_I2C_EEPROM_ADDR (0xA8 >> 1) -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 1 -#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 -#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 64 - -/* * Ethernet PHY configuration */ #define CONFIG_MII @@ -96,13 +70,17 @@ #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_MAXARGS 16 +#define CONFIG_CMDLINE_EDITING /* * Environment settings */ -#define CONFIG_ENV_IS_NOWHERE -#define CONFIG_ENV_SIZE SZ_512 -#define CONFIG_ENV_OFFSET 0 +#define CONFIG_ENV_IS_IN_FAT +#define CONFIG_ENV_SIZE SZ_16K +#define FAT_ENV_INTERFACE "mmc" +#define FAT_ENV_DEVICE_AND_PART "0:1" +#define FAT_ENV_FILE "uboot.env" +#define CONFIG_FAT_WRITE /* * Environment configuration diff --git a/include/configs/hsdk.h b/include/configs/hsdk.h new file mode 100644 index 00000000000..28ac090c052 --- /dev/null +++ b/include/configs/hsdk.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2017 Synopsys, Inc. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _CONFIG_HSDK_H_ +#define _CONFIG_HSDK_H_ + +#include <linux/sizes.h> + +/* + * CPU configuration + */ +#define ARC_PERIPHERAL_BASE 0xF0000000 +#define ARC_DWMMC_BASE (ARC_PERIPHERAL_BASE + 0xA000) +#define ARC_DWGMAC_BASE (ARC_PERIPHERAL_BASE + 0x18000) + +/* + * Memory configuration + */ +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE + +#define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000 +#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE +#define CONFIG_SYS_SDRAM_SIZE SZ_1G + +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE) + +#define CONFIG_SYS_MALLOC_LEN SZ_2M +#define CONFIG_SYS_BOOTM_LEN SZ_32M +#define CONFIG_SYS_LOAD_ADDR 0x82000000 + +/* + * This board might be of different versions so handle it + */ +#define CONFIG_BOARD_TYPES + +/* + * UART configuration + */ +#define CONFIG_DW_SERIAL +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_CLK 33330000 +#define CONFIG_SYS_NS16550_MEM32 + +/* + * Ethernet PHY configuration + */ +#define CONFIG_MII + +/* + * USB 1.1 configuration + */ +#define CONFIG_USB_OHCI_NEW +#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1 + +/* + * Environment settings + */ +#define CONFIG_ENV_SIZE SZ_16K +#define CONFIG_ENV_IS_IN_FAT +#define FAT_ENV_INTERFACE "mmc" +#define FAT_ENV_DEVICE_AND_PART "0:1" +#define FAT_ENV_FILE "uboot.env" +#define CONFIG_FAT_WRITE + +/* + * Environment configuration + */ +#define CONFIG_BOOTFILE "uImage" +#define CONFIG_BOOTARGS "console=ttyS0,115200n8" +#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR + +/* + * Console configuration + */ +#define CONFIG_AUTO_COMPLETE +#define CONFIG_CMDLINE_EDITING +#define CONFIG_SYS_LONGHELP +#define CONFIG_SYS_MAXARGS 16 +#define CONFIG_SYS_CBSIZE SZ_256 +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) + +/* + * Misc utility configuration + */ +#define CONFIG_BOUNCE_BUFFER + +#endif /* _CONFIG_HSDK_H_ */ diff --git a/include/configs/nsim.h b/include/configs/nsim.h index d6d26c74b43..5bbf6108463 100644 --- a/include/configs/nsim.h +++ b/include/configs/nsim.h @@ -37,6 +37,7 @@ */ #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_MAXARGS 16 +#define CONFIG_CMDLINE_EDITING /* * Environment settings diff --git a/include/configs/tb100.h b/include/configs/tb100.h index 115b3b3c5be..fe8e6c4e3b3 100644 --- a/include/configs/tb100.h +++ b/include/configs/tb100.h @@ -60,6 +60,7 @@ #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_MAXARGS 16 +#define CONFIG_CMDLINE_EDITING /* * Environment settings |