@@ -982,6 +982,13 @@ config STM32
select DM
select DM_SERIAL
+config ARCH_STI
+ bool "Support STMicrolectronics SoCs"
+ select CPU_V7
+ help
+ Support for STMicroelectronics STiH407/10 SoC family.
+ This SoC is used on Linaro 96Board STiH410-B2260
+
config ARCH_ROCKCHIP
bool "Support Rockchip SoCs"
select OF_CONTROL
@@ -1060,6 +1067,8 @@ source "arch/arm/mach-snapdragon/Kconfig"
source "arch/arm/mach-socfpga/Kconfig"
+source "arch/arm/mach-sti/Kconfig"
+
source "arch/arm/mach-stm32/Kconfig"
source "arch/arm/mach-tegra/Kconfig"
@@ -71,6 +71,7 @@ machine-$(CONFIG_ARCH_SNAPDRAGON) += snapdragon
machine-$(CONFIG_ARCH_SOCFPGA) += socfpga
machine-$(CONFIG_ARCH_RMOBILE) += rmobile
machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
+machine-$(CONFIG_ARCH_STI) += sti
machine-$(CONFIG_STM32) += stm32
machine-$(CONFIG_TEGRA) += tegra
machine-$(CONFIG_ARCH_UNIPHIER) += uniphier
new file mode 100644
@@ -0,0 +1,20 @@
+/*
+ * pins definition for STiH410-B2260
+ *
+ * (C) Copyright 2017 Patrice Chotard <patrice.chotard@st.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _STI_GPIO_H_
+#define _STI_GPIO_H_
+
+struct sti_pin_desc {
+ unsigned char bank;
+ unsigned char pin;
+ unsigned char alt;
+ int dir;
+};
+
+#endif /* _STI_GPIO_H_ */
+
new file mode 100644
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2017 Patrice Chotard <patrice.chotard@st.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _STI_H_
+#define _STI_H_
+
+/* A9_GLOBAL_TIMER_BASE */
+#define STI_A9_CONFIG_BASE 0x08760000
+#define STI_A9_GLOBAL_TIMER_BASE (STI_A9_CONFIG_BASE + 0x0200)
+
+#endif /* _STI_H_ */
new file mode 100644
@@ -0,0 +1,20 @@
+/*
+ * Configuration/Status Registers for STiH410 SoC
+ *
+ * (C) Copyright 2017 Patrice Chotard <patrice.chotard@st.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _STI_SYSCFG_H_
+#define _STI_SYSCFG_H_
+
+#define STIH410_SYSCONF0_BASE 0x09620000 /* 0-999 */
+#define STIH410_SYSCONF1_BASE 0x09280000 /* 1000-1999 */
+#define STIH410_SYSCONF2_BASE 0x09290000 /* 2000-2999 */
+#define STIH410_SYSCONF3_BASE 0x092a0000 /* 3000-3999 */
+#define STIH410_SYSCONF4_BASE 0x09600000 /* 4000-4999 */
+#define STIH410_SYSCONF5_BASE 0x092b0000 /* 5000-5999 */
+#define STIH410_SYSCONF6_BASE 0x092c0000 /* 6000-6999 */
+
+#endif /* _STI_SYSCFG_ */
new file mode 100644
@@ -0,0 +1,31 @@
+if ARCH_STI
+
+config SYS_SOC
+ default "stih410"
+
+choice
+ prompt "STiH410 board select"
+
+config TARGET_STIH410_B2260
+ bool "96Boards STiH410-B2260"
+ help
+ Support for 96Board STiH410-B2260 based on STMicrolectronics
+ STiH410 soc. This board complies with 96Board Open Platform
+ Specifications. Features:
+ - 1GB DDR
+ - On-Board USB combo WiFi/Bluetooth RTL8723BU
+ with PCB soldered antenna
+ - Ethernet 1000-BaseT
+ - Sata
+ - HDMI
+ - 2 x USB2 type A
+ - micro USB2 type AB
+ - SD card slot
+ - High speed connector (SD/I2C/USB interfaces)
+ - Slow speed connector (UART/I2C/GPIO/SPI/PCM interfaces)
+
+endchoice
+
+source "board/st/stih410-b2260/Kconfig"
+
+endif
new file mode 100644
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2017
+# Patrice Chotard, <patrice.chotard@st.com>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += cpu.o timer.o
new file mode 100644
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2017 Patrice Chotard <patrice.chotard@st.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include <common.h>
+#include <asm/arch/syscfg.h>
+#include <asm/io.h>
+
+void reset_cpu(ulong addr)
+{
+ unsigned long *sysconf;
+
+ sysconf = (unsigned long *)STIH410_SYSCONF4_BASE;
+ generic_clear_bit(0, sysconf);
+}
new file mode 100644
@@ -0,0 +1,47 @@
+/*
+ * (C) Copyright 2017 Patrice Chotard <patrice.chotard@st.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sti.h>
+#include <asm/arch-armv7/globaltimer.h>
+
+static struct globaltimer * const global_timer =
+ (struct globaltimer *)STI_A9_GLOBAL_TIMER_BASE;
+
+static u64 get_cpu_global_timer(void)
+{
+ u32 low, high;
+ u64 timer;
+
+ u32 old = readl(&global_timer->cnt_h);
+ while (1) {
+ low = readl(&global_timer->cnt_l);
+ high = readl(&global_timer->cnt_h);
+ if (old == high)
+ break;
+ else
+ old = high;
+ }
+ timer = high;
+ return (u64)((timer << 32) | low);
+}
+
+int timer_init(void)
+{
+ writel(0x01, &global_timer->ctl);
+ return 0;
+}
+
+unsigned long long get_ticks(void)
+{
+ return get_cpu_global_timer();
+}
+
+ulong get_tbclk(void)
+{
+ return (ulong)(CONFIG_SYS_HZ_CLOCK >> 1);
+}