diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-16 10:54:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-16 10:54:37 +0200 |
commit | 30d6ac7c240e224287f495e9be203bc7d2c4bc74 (patch) | |
tree | b5056e2b425482dc00aad165eabecf0b97d1ea00 /arch | |
parent | 906bc49aab6a2679d3ee8da31af79844db3dd940 (diff) | |
parent | 4317fb84cbb971c5e7d889bc57bbd34ca319aa70 (diff) | |
download | barebox-30d6ac7c240e224287f495e9be203bc7d2c4bc74.tar.gz barebox-30d6ac7c240e224287f495e9be203bc7d2c4bc74.tar.xz |
Merge branch 'for-next/rockchip'
Diffstat (limited to 'arch')
16 files changed, 76 insertions, 124 deletions
diff --git a/arch/arm/boards/radxa-rock/Makefile b/arch/arm/boards/radxa-rock/Makefile index 79c8aec199..ec930bc264 100644 --- a/arch/arm/boards/radxa-rock/Makefile +++ b/arch/arm/boards/radxa-rock/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_MACH_RADXA_ROCK) += board.o lwl-y += lowlevel.o +bbenv-y += defaultenv-radxa-rock diff --git a/arch/arm/boards/radxa-rock/board.c b/arch/arm/boards/radxa-rock/board.c index 5c87f64897..0ada54a849 100644 --- a/arch/arm/boards/radxa-rock/board.c +++ b/arch/arm/boards/radxa-rock/board.c @@ -4,6 +4,7 @@ #include <common.h> #include <init.h> #include <io.h> +#include <envfs.h> #include <i2c/i2c.h> #include <i2c/i2c-gpio.h> #include <mach/rk3188-regs.h> @@ -51,6 +52,8 @@ static int devices_init(void) writel((RK_SOC_CON0_REMAP << 16) | RK_SOC_CON0_REMAP, RK_GRF_BASE + RK_GRF_SOC_CON0); + defaultenv_append_directory(defaultenv_radxa_rock); + return 0; } device_initcall(devices_init); diff --git a/arch/arm/boards/radxa-rock/env/boot/mshc1 b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/boot/mshc1 index c24a88edc5..c24a88edc5 100644 --- a/arch/arm/boards/radxa-rock/env/boot/mshc1 +++ b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/boot/mshc1 diff --git a/arch/arm/boards/radxa-rock/env/boot/mshc1-old b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/boot/mshc1-old index 2e43a3aafe..2e43a3aafe 100644 --- a/arch/arm/boards/radxa-rock/env/boot/mshc1-old +++ b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/boot/mshc1-old diff --git a/arch/arm/boards/radxa-rock/env/init/bootsource b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/init/bootsource index 4e8299b8dd..4e8299b8dd 100644 --- a/arch/arm/boards/radxa-rock/env/init/bootsource +++ b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/init/bootsource diff --git a/arch/arm/boards/radxa-rock/env/nv/hostname b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/nv/hostname index 16523aca12..16523aca12 100644 --- a/arch/arm/boards/radxa-rock/env/nv/hostname +++ b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/nv/hostname diff --git a/arch/arm/boards/radxa-rock/env/nv/linux.bootargs.console b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/nv/linux.bootargs.console index 37a03fd430..37a03fd430 100644 --- a/arch/arm/boards/radxa-rock/env/nv/linux.bootargs.console +++ b/arch/arm/boards/radxa-rock/defaultenv-radxa-rock/nv/linux.bootargs.console diff --git a/arch/arm/configs/rk3188_defconfig b/arch/arm/configs/rk3188_defconfig deleted file mode 100644 index 318cd9de42..0000000000 --- a/arch/arm/configs/rk3188_defconfig +++ /dev/null @@ -1,98 +0,0 @@ -CONFIG_ARCH_ROCKCHIP=y -CONFIG_CACHE_L2X0=y -CONFIG_MACH_RADXA_ROCK=y -CONFIG_THUMB2_BAREBOX=y -CONFIG_ARM_BOARD_APPEND_ATAG=y -CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y -CONFIG_ARM_UNWIND=y -CONFIG_MMU=y -CONFIG_MALLOC_SIZE=0x0 -CONFIG_MALLOC_TLSF=y -CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y -CONFIG_PROMPT="radxa-rock:" -CONFIG_HUSH_FANCY_PROMPT=y -CONFIG_CMDLINE_EDITING=y -CONFIG_AUTO_COMPLETE=y -CONFIG_BOOTM_SHOW_TYPE=y -CONFIG_BOOTM_VERBOSE=y -CONFIG_BOOTM_INITRD=y -CONFIG_BOOTM_OFTREE=y -CONFIG_BOOTM_OFTREE_UIMAGE=y -CONFIG_BOOTM_AIMAGE=y -CONFIG_CONSOLE_ACTIVATE_NONE=y -CONFIG_DEFAULT_COMPRESSION_LZO=y -CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/radxa-rock/env" -CONFIG_CMD_DMESG=y -CONFIG_LONGHELP=y -CONFIG_CMD_IOMEM=y -CONFIG_CMD_MEMINFO=y -CONFIG_CMD_ARM_MMUINFO=y -CONFIG_CMD_BOOTZ=y -CONFIG_CMD_GO=y -CONFIG_CMD_RESET=y -CONFIG_CMD_UIMAGE=y -CONFIG_CMD_PARTITION=y -CONFIG_CMD_EXPORT=y -CONFIG_CMD_DEFAULTENV=y -CONFIG_CMD_LOADENV=y -CONFIG_CMD_PRINTENV=y -CONFIG_CMD_MAGICVAR=y -CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_SAVEENV=y -CONFIG_CMD_FILETYPE=y -CONFIG_CMD_LN=y -CONFIG_CMD_MD5SUM=y -CONFIG_CMD_SHA1SUM=y -CONFIG_CMD_SHA224SUM=y -CONFIG_CMD_SHA256SUM=y -CONFIG_CMD_UNCOMPRESS=y -CONFIG_CMD_LET=y -CONFIG_CMD_MSLEEP=y -CONFIG_CMD_READF=y -CONFIG_CMD_SLEEP=y -CONFIG_CMD_DHCP=y -CONFIG_CMD_MIITOOL=y -CONFIG_CMD_PING=y -CONFIG_CMD_TFTP=y -CONFIG_CMD_ECHO_E=y -CONFIG_CMD_EDIT=y -CONFIG_CMD_READLINE=y -CONFIG_CMD_TIMEOUT=y -CONFIG_CMD_MM=y -CONFIG_CMD_CLK=y -CONFIG_CMD_DETECT=y -CONFIG_CMD_GPIO=y -CONFIG_CMD_I2C=y -CONFIG_CMD_OF_NODE=y -CONFIG_CMD_OF_PROPERTY=y -CONFIG_CMD_OF_DISPLAY_TIMINGS=y -CONFIG_CMD_OFTREE=y -CONFIG_CMD_TIME=y -CONFIG_NET=y -CONFIG_NET_NFS=y -CONFIG_NET_NETCONSOLE=y -CONFIG_OFDEVICE=y -CONFIG_OF_BAREBOX_DRIVERS=y -CONFIG_DRIVER_SERIAL_NS16550=y -CONFIG_DRIVER_NET_ARC_EMAC=y -CONFIG_SMSC_PHY=y -CONFIG_I2C_GPIO=y -CONFIG_MCI=y -CONFIG_MCI_STARTUP=y -CONFIG_MCI_MMC_BOOT_PARTITIONS=y -CONFIG_MCI_DW=y -CONFIG_MCI_DW_PIO=y -CONFIG_LED=y -CONFIG_LED_GPIO=y -CONFIG_LED_GPIO_OF=y -CONFIG_GENERIC_PHY=y -CONFIG_FS_CRAMFS=y -CONFIG_FS_EXT4=y -CONFIG_FS_TFTP=y -CONFIG_FS_NFS=y -CONFIG_FS_FAT=y -CONFIG_FS_BPKFS=y -CONFIG_FS_UIMAGEFS=y -CONFIG_LZO_DECOMPRESS=y diff --git a/arch/arm/configs/rk3288_defconfig b/arch/arm/configs/rockchip_v7a_defconfig index 156e07fcb1..41a63d3749 100644 --- a/arch/arm/configs/rk3288_defconfig +++ b/arch/arm/configs/rockchip_v7a_defconfig @@ -1,6 +1,8 @@ CONFIG_ARCH_ROCKCHIP=y -CONFIG_ARCH_RK3288=y +CONFIG_CACHE_L2X0=y +CONFIG_MACH_RADXA_ROCK=y CONFIG_MACH_PHYTEC_SOM_RK3288=y +CONFIG_BOARD_ARM_GENERIC_DT=y CONFIG_THUMB2_BAREBOX=y CONFIG_ARM_BOARD_APPEND_ATAG=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y @@ -24,7 +26,6 @@ CONFIG_CONSOLE_ACTIVATE_NONE=y CONFIG_DEFAULT_COMPRESSION_LZO=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y CONFIG_RESET_SOURCE=y -CONFIG_DEBUG_LL=y CONFIG_CMD_DMESG=y CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index f2fa3c6345..65bcbcac96 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -11,27 +11,23 @@ config RK_TIMER hex default 1 -choice - prompt "Select Rockchip SoC" - config ARCH_RK3188 - bool "Rockchip RK3188 SoCs" + bool config ARCH_RK3288 - bool "Rockchip RK3288 SoCs" + bool select CLOCKSOURCE_ROCKCHIP -endchoice comment "select Rockchip boards:" config MACH_RADXA_ROCK - depends on ARCH_RK3188 + select ARCH_RK3188 select I2C select MFD_ACT8846 bool "Radxa rock board" config MACH_PHYTEC_SOM_RK3288 - depends on ARCH_RK3288 + select ARCH_RK3288 select I2C bool "RK3288 phyCORE SOM" help diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 4ca7f17d8c..0188d0252f 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -1,2 +1,3 @@ +obj-y += rockchip.o obj-$(CONFIG_ARCH_RK3188) += rk3188.o obj-$(CONFIG_ARCH_RK3288) += rk3288.o diff --git a/arch/arm/mach-rockchip/include/mach/debug_ll.h b/arch/arm/mach-rockchip/include/mach/debug_ll.h index 9fde2976f1..7806aab8bb 100644 --- a/arch/arm/mach-rockchip/include/mach/debug_ll.h +++ b/arch/arm/mach-rockchip/include/mach/debug_ll.h @@ -6,14 +6,16 @@ #include <mach/rk3188-regs.h> #include <mach/rk3288-regs.h> -#ifdef CONFIG_ARCH_RK3188 +#ifdef CONFIG_DEBUG_LL + +#ifdef CONFIG_DEBUG_ROCKCHIP_RK3188_UART #define UART_CLOCK 100000000 #define RK_DEBUG_SOC RK3188 #define serial_out(a, v) writeb(v, a) #define serial_in(a) readb(a) -#elif defined CONFIG_ARCH_RK3288 +#elif defined CONFIG_DEBUG_ROCKCHIP_RK3288_UART #define UART_CLOCK 24000000 #define RK_DEBUG_SOC RK3288 @@ -70,4 +72,10 @@ static inline void PUTC_LL(char c) while ((serial_in(base + LSR) & LSR_THRE) == 0) ; } +#else +static inline void INIT_LL(void) +{ +} +#endif + #endif diff --git a/arch/arm/mach-rockchip/include/mach/rockchip.h b/arch/arm/mach-rockchip/include/mach/rockchip.h new file mode 100644 index 0000000000..8d37c67d4f --- /dev/null +++ b/arch/arm/mach-rockchip/include/mach/rockchip.h @@ -0,0 +1,22 @@ +#ifndef __MACH_ROCKCHIP_H +#define __MACH_ROCKCHIP_H + +#ifdef CONFIG_ARCH_RK3188 +int rk3188_init(void); +#else +static inline int rk3188_init(void) +{ + return -ENOTSUPP; +} +#endif + +#ifdef CONFIG_ARCH_RK3288 +int rk3288_init(void); +#else +static inline int rk3288_init(void) +{ + return -ENOTSUPP; +} +#endif + +#endif /* __MACH_ROCKCHIP_H */ diff --git a/arch/arm/mach-rockchip/rk3188.c b/arch/arm/mach-rockchip/rk3188.c index 572e9dc58f..178bf2be1d 100644 --- a/arch/arm/mach-rockchip/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188.c @@ -16,6 +16,7 @@ #include <init.h> #include <restart.h> #include <mach/rk3188-regs.h> +#include <mach/rockchip.h> static void __noreturn rockchip_restart_soc(struct restart_handler *rst) { @@ -27,10 +28,9 @@ static void __noreturn rockchip_restart_soc(struct restart_handler *rst) hang(); } -static int restart_register_feature(void) +int rk3188_init(void) { restart_handler_register_fn("soc", rockchip_restart_soc); return 0; } -coredevice_initcall(restart_register_feature); diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c index 9076fd9227..2a1d4ab7a2 100644 --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -21,6 +21,7 @@ #include <mach/rk3288-regs.h> #include <mach/cru_rk3288.h> #include <mach/hardware.h> +#include <mach/rockchip.h> static void __noreturn rockchip_restart_soc(struct restart_handler *rst) { @@ -58,17 +59,6 @@ static void rk3288_detect_reset_reason(void) } } -static int rk3288_init(void) -{ - restart_handler_register_fn("soc", rockchip_restart_soc); - - if (IS_ENABLED(CONFIG_RESET_SOURCE)) - rk3288_detect_reset_reason(); - - return 0; -} -postcore_initcall(rk3288_init); - /* * ATM we are not able to determine the boot source. * So let's handle the environment on eMMC, regardless which device @@ -89,4 +79,15 @@ static int rk3288_env_init(void) return 0; } -device_initcall(rk3288_env_init); + +int rk3288_init(void) +{ + restart_handler_register_fn("soc", rockchip_restart_soc); + + if (IS_ENABLED(CONFIG_RESET_SOURCE)) + rk3288_detect_reset_reason(); + + rk3288_env_init(); + + return 0; +} diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c new file mode 100644 index 0000000000..b0fbb49457 --- /dev/null +++ b/arch/arm/mach-rockchip/rockchip.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <common.h> +#include <init.h> +#include <mach/rockchip.h> + +static int rockchip_init(void) +{ + if (of_machine_is_compatible("rockchip,rk3188")) + rk3188_init(); + else if (of_machine_is_compatible("rockchip,rk3288")) + rk3288_init(); + else + pr_err("Unknown rockchip SoC\n"); + + return 0; +} +postcore_initcall(rockchip_init); |