diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-12 07:10:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-12 07:10:19 +0200 |
commit | f9dfe479ebacbb3efacef4525682546713b11597 (patch) | |
tree | 64b26ae51c86b9b1419d8a62baf5d2f5948f3f51 /arch/arm | |
parent | ac5e1f63aafb73a6ea2356822029ef391b6234d2 (diff) | |
parent | 9f30aa3f143eda22ba3cf9e36c05213239a2fe83 (diff) | |
download | barebox-f9dfe479ebacbb3efacef4525682546713b11597.tar.gz barebox-f9dfe479ebacbb3efacef4525682546713b11597.tar.xz |
Merge branch 'for-next/stm32'
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/stm32mp157c-dk2/lowlevel.c | 4 | ||||
-rw-r--r-- | arch/arm/configs/stm32mp_defconfig (renamed from arch/arm/configs/stm32mp1_defconfig) | 16 | ||||
-rw-r--r-- | arch/arm/cpu/psci.c | 6 | ||||
-rw-r--r-- | arch/arm/cpu/sm.c | 29 | ||||
-rw-r--r-- | arch/arm/dts/stm32mp157a-dk1.dts | 58 | ||||
-rw-r--r-- | arch/arm/dts/stm32mp157a-dk1.dtsi | 36 | ||||
-rw-r--r-- | arch/arm/dts/stm32mp157c-dk2.dts | 10 | ||||
-rw-r--r-- | arch/arm/dts/stm32mp157c.dtsi | 15 | ||||
-rw-r--r-- | arch/arm/include/asm/gic.h | 29 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/Kconfig (renamed from arch/arm/mach-stm32mp1/Kconfig) | 3 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/Makefile (renamed from arch/arm/mach-stm32mp1/Makefile) | 0 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/include/mach/debug_ll.h (renamed from arch/arm/mach-stm32mp1/include/mach/debug_ll.h) | 0 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/include/mach/stm32.h (renamed from arch/arm/mach-stm32mp1/include/mach/stm32.h) | 0 |
15 files changed, 108 insertions, 105 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 480c6f0117..0f5190b417 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -207,7 +207,7 @@ config ARCH_S3C64xx select CPU_V6 select GENERIC_GPIO -config ARCH_STM32MP1 +config ARCH_STM32MP bool "ST stm32mp1xx" select CPU_V7 select HAVE_PBL_MULTI_IMAGES @@ -216,6 +216,7 @@ config ARCH_STM32MP1 select COMMON_CLK_OF_PROVIDER select HAS_DEBUG_LL select HAVE_CLK + select GPIOLIB config ARCH_VERSATILE bool "ARM Versatile boards (ARM926EJ-S)" @@ -304,7 +305,7 @@ source "arch/arm/mach-pxa/Kconfig" source "arch/arm/mach-rockchip/Kconfig" source "arch/arm/mach-samsung/Kconfig" source "arch/arm/mach-socfpga/Kconfig" -source "arch/arm/mach-stm32mp1/Kconfig" +source "arch/arm/mach-stm32mp/Kconfig" source "arch/arm/mach-versatile/Kconfig" source "arch/arm/mach-vexpress/Kconfig" source "arch/arm/mach-tegra/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 4d54f339f1..5cb46f6613 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -98,7 +98,7 @@ machine-$(CONFIG_ARCH_PXA) := pxa machine-$(CONFIG_ARCH_ROCKCHIP) := rockchip machine-$(CONFIG_ARCH_SAMSUNG) := samsung machine-$(CONFIG_ARCH_SOCFPGA) := socfpga -machine-$(CONFIG_ARCH_STM32MP1) := stm32mp1 +machine-$(CONFIG_ARCH_STM32MP) := stm32mp machine-$(CONFIG_ARCH_VERSATILE) := versatile machine-$(CONFIG_ARCH_VEXPRESS) := vexpress machine-$(CONFIG_ARCH_TEGRA) := tegra diff --git a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c index b8e5959bef..566ace79c9 100644 --- a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c +++ b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c @@ -5,7 +5,7 @@ #include <mach/stm32.h> #include <debug_ll.h> -extern char __dtb_stm32mp157c_dk2_start[]; +extern char __dtb_z_stm32mp157c_dk2_start[]; ENTRY_FUNCTION(start_stm32mp157c_dk2, r0, r1, r2) { @@ -13,7 +13,7 @@ ENTRY_FUNCTION(start_stm32mp157c_dk2, r0, r1, r2) arm_cpu_lowlevel_init(); - fdt = __dtb_stm32mp157c_dk2_start + get_runtime_offset(); + fdt = __dtb_z_stm32mp157c_dk2_start + get_runtime_offset(); barebox_arm_entry(STM32_DDR_BASE, SZ_512M, fdt); } diff --git a/arch/arm/configs/stm32mp1_defconfig b/arch/arm/configs/stm32mp_defconfig index 0afbbff7fd..9f30bb1caa 100644 --- a/arch/arm/configs/stm32mp1_defconfig +++ b/arch/arm/configs/stm32mp_defconfig @@ -1,4 +1,4 @@ -CONFIG_ARCH_STM32MP1=y +CONFIG_ARCH_STM32MP=y CONFIG_MACH_STM32MP157C_DK2=y CONFIG_THUMB2_BAREBOX=y CONFIG_ARM_BOARD_APPEND_ATAG=y @@ -25,7 +25,6 @@ CONFIG_CONSOLE_ALLOW_COLOR=y CONFIG_PBL_CONSOLE=y CONFIG_PARTITION=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_POLLER=y CONFIG_RESET_SOURCE=y CONFIG_DEBUG_INITCALLS=y CONFIG_CMD_DMESG=y @@ -71,6 +70,9 @@ CONFIG_CMD_MM=y CONFIG_CMD_CLK=y CONFIG_CMD_DETECT=y CONFIG_CMD_FLASH=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_LED=y +CONFIG_CMD_WD=y CONFIG_CMD_BAREBOX_UPDATE=y CONFIG_CMD_OF_NODE=y CONFIG_CMD_OF_PROPERTY=y @@ -85,7 +87,14 @@ CONFIG_DRIVER_NET_DESIGNWARE_GENERIC=y CONFIG_AT803X_PHY=y CONFIG_MICREL_PHY=y # CONFIG_SPI is not set -# CONFIG_PINCTRL is not set +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_LED_GPIO_OF=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_POLLER=y +CONFIG_STM32_IWDG_WATCHDOG=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED=y CONFIG_FS_EXT4=y CONFIG_FS_TFTP=y CONFIG_FS_NFS=y @@ -93,5 +102,4 @@ CONFIG_FS_FAT=y CONFIG_FS_FAT_WRITE=y CONFIG_FS_FAT_LFN=y CONFIG_ZLIB=y -CONFIG_LZO_DECOMPRESS=y CONFIG_CRC8=y diff --git a/arch/arm/cpu/psci.c b/arch/arm/cpu/psci.c index 5c662cd0b9..a976ddbb5c 100644 --- a/arch/arm/cpu/psci.c +++ b/arch/arm/cpu/psci.c @@ -138,8 +138,8 @@ static unsigned long psci_system_off(void) { psci_printf("%s\n", __func__); - if (psci_ops->system_reset) - psci_ops->system_reset(); + if (psci_ops->system_off) + psci_ops->system_off(); while(1); @@ -293,4 +293,4 @@ BAREBOX_CMD_START(smc) BAREBOX_CMD_DESC("secure monitor test command") BAREBOX_CMD_GROUP(CMD_GRP_MISC) BAREBOX_CMD_END -#endif
\ No newline at end of file +#endif diff --git a/arch/arm/cpu/sm.c b/arch/arm/cpu/sm.c index d9d62fbd9d..b7a9eae89b 100644 --- a/arch/arm/cpu/sm.c +++ b/arch/arm/cpu/sm.c @@ -22,9 +22,6 @@ #include "mmu.h" -/* valid bits in CBAR register / PERIPHBASE value */ -#define CBAR_MASK 0xFFFF8000 - static unsigned int read_id_pfr1(void) { unsigned int reg; @@ -51,30 +48,6 @@ static void write_mvbar(u32 val) asm("mcr p15, 0, %0, c12, c0, 1" : : "r"(val)); } -static unsigned long get_cbar(void) -{ - unsigned periphbase; - - /* get the GIC base address from the CBAR register */ - asm("mrc p15, 4, %0, c15, c0, 0\n" : "=r" (periphbase)); - - /* the PERIPHBASE can be mapped above 4 GB (lower 8 bits used to - * encode this). Bail out here since we cannot access this without - * enabling paging. - */ - if ((periphbase & 0xff) != 0) { - pr_err("PERIPHBASE is above 4 GB, no access.\n"); - return -1; - } - - return periphbase & CBAR_MASK; -} - -static unsigned long get_gicd_base_address(void) -{ - return get_cbar() + GIC_DIST_OFFSET; -} - static int cpu_is_virt_capable(void) { return read_id_pfr1() & (1 << 12); @@ -267,4 +240,4 @@ static int sm_init(void) return 0; } -device_initcall(sm_init);
\ No newline at end of file +device_initcall(sm_init); diff --git a/arch/arm/dts/stm32mp157a-dk1.dts b/arch/arm/dts/stm32mp157a-dk1.dts index 741284a444..f2cafae66b 100644 --- a/arch/arm/dts/stm32mp157a-dk1.dts +++ b/arch/arm/dts/stm32mp157a-dk1.dts @@ -4,59 +4,5 @@ * Author: Alexandre Torgue <alexandre.torgue@st.com>. */ -/dts-v1/; - -#include "stm32mp157c.dtsi" -#include <arm/stm32mp157c.dtsi> -#include <arm/stm32mp157-pinctrl.dtsi> - -/ { - model = "STMicroelectronics STM32MP157A-DK1 Discovery Board"; - compatible = "st,stm32mp157a-dk1", "st,stm32mp157"; - - aliases { - ethernet0 = ðernet0; - serial0 = &uart4; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - sram: sram@10050000 { - compatible = "mmio-sram"; - reg = <0x10050000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x10050000 0x10000>; - - dma_pool: dma_pool@0 { - reg = <0x0 0x10000>; - pool; - }; - }; -}; - -ðernet0 { - status = "okay"; - pinctrl-0 = <ðernet0_rgmii_pins_a>; - pinctrl-names = "default", "sleep"; - phy-mode = "rgmii"; - max-speed = <1000>; - phy-handle = <&phy0>; - - mdio0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "snps,dwmac-mdio"; - phy0: ethernet-phy@0 { - reg = <0>; - }; - }; -}; - -&uart4 { - pinctrl-names = "default"; - pinctrl-0 = <&uart4_pins_a>; - status = "okay"; -}; +#include <arm/stm32mp157a-dk1.dts> +#include "stm32mp157a-dk1.dtsi" diff --git a/arch/arm/dts/stm32mp157a-dk1.dtsi b/arch/arm/dts/stm32mp157a-dk1.dtsi new file mode 100644 index 0000000000..cd3d614d46 --- /dev/null +++ b/arch/arm/dts/stm32mp157a-dk1.dtsi @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Alexandre Torgue <alexandre.torgue@st.com>. + */ + +#include "stm32mp157c.dtsi" +#include <dt-bindings/gpio/gpio.h> + +/ { + led { + red { + label = "error"; + gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; + default-state = "off"; + status = "okay"; + }; + + blue { + default-state = "on"; + }; + }; + + sram: sram@10050000 { + compatible = "mmio-sram"; + reg = <0x10050000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x10050000 0x10000>; + + dma_pool: dma_pool@0 { + reg = <0x0 0x10000>; + pool; + }; + }; +}; diff --git a/arch/arm/dts/stm32mp157c-dk2.dts b/arch/arm/dts/stm32mp157c-dk2.dts index 7565cabc3d..6e73162ea4 100644 --- a/arch/arm/dts/stm32mp157c-dk2.dts +++ b/arch/arm/dts/stm32mp157c-dk2.dts @@ -4,11 +4,5 @@ * Author: Alexandre Torgue <alexandre.torgue@st.com>. */ -/dts-v1/; - -#include "stm32mp157a-dk1.dts" - -/ { - model = "STMicroelectronics STM32MP157C-DK2 Discovery Board"; - compatible = "st,stm32mp157c-dk2", "st,stm32mp157"; -}; +#include <arm/stm32mp157c-dk2.dts> +#include "stm32mp157a-dk1.dtsi" diff --git a/arch/arm/dts/stm32mp157c.dtsi b/arch/arm/dts/stm32mp157c.dtsi index fa0d00ff02..b97622c8d4 100644 --- a/arch/arm/dts/stm32mp157c.dtsi +++ b/arch/arm/dts/stm32mp157c.dtsi @@ -4,4 +4,19 @@ /* Needed to let barebox find the clock nodes */ compatible = "simple-bus"; }; + + aliases { + gpio0 = &gpioa; + gpio1 = &gpiob; + gpio2 = &gpioc; + gpio3 = &gpiod; + gpio4 = &gpioe; + gpio5 = &gpiof; + gpio6 = &gpiog; + gpio7 = &gpioh; + gpio8 = &gpioi; + gpio9 = &gpioj; + gpio10 = &gpiok; + gpio11 = &gpioz; + }; }; diff --git a/arch/arm/include/asm/gic.h b/arch/arm/include/asm/gic.h index bd3a80cdf7..f83f528141 100644 --- a/arch/arm/include/asm/gic.h +++ b/arch/arm/include/asm/gic.h @@ -107,4 +107,33 @@ #define ICC_SGI1R_EL1 S3_0_C12_C11_5 #define ICC_ASGI1R_EL1 S3_0_C12_C11_6 +#ifndef __ASSEMBLY__ +/* valid bits in CBAR register / PERIPHBASE value */ +#define CBAR_MASK 0xFFFF8000 + +static inline unsigned long get_cbar(void) +{ + unsigned periphbase; + + /* get the GIC base address from the CBAR register */ + asm("mrc p15, 4, %0, c15, c0, 0\n" : "=r" (periphbase)); + + /* the PERIPHBASE can be mapped above 4 GB (lower 8 bits used to + * encode this). Bail out here since we cannot access this without + * enabling paging. + */ + if ((periphbase & 0xff) != 0) { + pr_err("PERIPHBASE is above 4 GB, no access.\n"); + return -1; + } + + return periphbase & CBAR_MASK; +} + +static inline unsigned long get_gicd_base_address(void) +{ + return get_cbar() + GIC_DIST_OFFSET; +} +#endif + #endif /* __GIC_H__ */ diff --git a/arch/arm/mach-stm32mp1/Kconfig b/arch/arm/mach-stm32mp/Kconfig index cc7cf23cfb..be16294f5a 100644 --- a/arch/arm/mach-stm32mp1/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -1,10 +1,11 @@ -if ARCH_STM32MP1 +if ARCH_STM32MP config ARCH_STM32MP1157 bool config MACH_STM32MP157C_DK2 select ARCH_STM32MP1157 + select ARM_USE_COMPRESSED_DTB bool "STM32MP157C-DK2 board" endif diff --git a/arch/arm/mach-stm32mp1/Makefile b/arch/arm/mach-stm32mp/Makefile index 16a218658a..16a218658a 100644 --- a/arch/arm/mach-stm32mp1/Makefile +++ b/arch/arm/mach-stm32mp/Makefile diff --git a/arch/arm/mach-stm32mp1/include/mach/debug_ll.h b/arch/arm/mach-stm32mp/include/mach/debug_ll.h index 99fedb91fe..99fedb91fe 100644 --- a/arch/arm/mach-stm32mp1/include/mach/debug_ll.h +++ b/arch/arm/mach-stm32mp/include/mach/debug_ll.h diff --git a/arch/arm/mach-stm32mp1/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h index f9bdb788b9..f9bdb788b9 100644 --- a/arch/arm/mach-stm32mp1/include/mach/stm32.h +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h |