diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-06-11 11:33:34 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-06-11 11:33:34 +0200 |
commit | 543a7c8e10e0dbc1af8207e4a30e439c4c66c473 (patch) | |
tree | 05189f4b5380690ff8bb2aa5e1c2b5be3a5ce9d0 /arch/arm/boards | |
parent | cde5183f1ab7ba0936e84ec26dffc57a27879046 (diff) | |
parent | ead7521b93a3ece8e037090d03b7f9ac0c3e9026 (diff) | |
download | barebox-543a7c8e10e0dbc1af8207e4a30e439c4c66c473.tar.gz barebox-543a7c8e10e0dbc1af8207e4a30e439c4c66c473.tar.xz |
Merge branch 'for-next/imx'
Diffstat (limited to 'arch/arm/boards')
23 files changed, 263 insertions, 7 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile index cbd6bd1ed6..bdf78d068d 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -23,6 +23,7 @@ obj-$(CONFIG_MACH_CFA10036) += crystalfontz-cfa10036/ obj-$(CONFIG_MACH_CHUMBY) += chumby_falconwing/ obj-$(CONFIG_MACH_CLEP7212) += clep7212/ obj-$(CONFIG_MACH_DFI_FS700_M60) += dfi-fs700-m60/ +obj-$(CONFIG_MACH_DIGI_CCIMX6ULSBCPRO) += digi-ccimx6ulsom/ obj-$(CONFIG_MACH_DUCKBILL) += duckbill/ obj-$(CONFIG_MACH_DSS11) += dss11/ obj-$(CONFIG_MACH_EDB93012) += edb93xx/ @@ -166,4 +167,4 @@ obj-$(CONFIG_MACH_ZII_VF610_DEV) += zii-vf610-dev/ obj-$(CONFIG_MACH_ZII_IMX7D_RPU2) += zii-imx7d-rpu2/ obj-$(CONFIG_MACH_WAGO_PFC_AM35XX) += wago-pfc-am35xx/ obj-$(CONFIG_MACH_LS1046ARDB) += ls1046ardb/ -obj-$(CONFIG_MACH_TQMLS1046A) += tqmls1046a/
\ No newline at end of file +obj-$(CONFIG_MACH_TQMLS1046A) += tqmls1046a/ diff --git a/arch/arm/boards/digi-ccimx6ulsom/Makefile b/arch/arm/boards/digi-ccimx6ulsom/Makefile new file mode 100644 index 0000000000..01c7a259e9 --- /dev/null +++ b/arch/arm/boards/digi-ccimx6ulsom/Makefile @@ -0,0 +1,2 @@ +obj-y += board.o +lwl-y += lowlevel.o diff --git a/arch/arm/boards/digi-ccimx6ulsom/board.c b/arch/arm/boards/digi-ccimx6ulsom/board.c new file mode 100644 index 0000000000..1fb451548f --- /dev/null +++ b/arch/arm/boards/digi-ccimx6ulsom/board.c @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019 Rouven Czerwinski, Pengutronix + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation. + * + */ + +#include <common.h> +#include <init.h> +#include <mach/generic.h> +#include <mach/bbu.h> + +static int digi_ccimx6ulsbcpro_device_init(void) +{ + if (!of_machine_is_compatible("digi,ccimx6ulsbcpro")) + return 0; + + imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT); + + barebox_set_hostname("ccimx6ulsbcpro"); + + return 0; +} +device_initcall(digi_ccimx6ulsbcpro_device_init); diff --git a/arch/arm/boards/digi-ccimx6ulsom/flash-header-imx6ul-ccimx6ulsbcpro.imxcfg b/arch/arm/boards/digi-ccimx6ulsom/flash-header-imx6ul-ccimx6ulsbcpro.imxcfg new file mode 100644 index 0000000000..36edad7a3e --- /dev/null +++ b/arch/arm/boards/digi-ccimx6ulsom/flash-header-imx6ul-ccimx6ulsbcpro.imxcfg @@ -0,0 +1,82 @@ +loadaddr 0x80000000 +soc imx6 +dcdofs 0x400 + +/* Enable all clocks */ +wm 32 0x020c4068 0xffffffff +wm 32 0x020c406c 0xffffffff +wm 32 0x020c4070 0xffffffff +wm 32 0x020c4074 0xffffffff +wm 32 0x020c4078 0xffffffff +wm 32 0x020c407c 0xffffffff +wm 32 0x020c4080 0xffffffff + +/* IOMUX */ +/* DDR IO type */ +wm 32 0x020E04B4 0x000C0000 +wm 32 0x020E04AC 0x00000000 +/* Clock */ +wm 32 0x020E027C 0x00000030 +/* Control */ +wm 32 0x020E0250 0x00000030 +wm 32 0x020E024C 0x00000030 +wm 32 0x020E0490 0x00000030 +wm 32 0x020E0288 0x00000030 +wm 32 0x020E0270 0x00000000 +wm 32 0x020E0260 0x00000030 +wm 32 0x020E0264 0x00000030 +wm 32 0x020E04A0 0x00000030 +/* Data strobe */ +wm 32 0x020E0494 0x00020000 +wm 32 0x020E0280 0x00000030 +wm 32 0x020E0284 0x00000030 +/* Data */ +wm 32 0x020E04B0 0x00020000 +wm 32 0x020E0498 0x00000030 +wm 32 0x020E04A4 0x00000030 +wm 32 0x020E0244 0x00000030 +wm 32 0x020E0248 0x00000030 + +/* DDR Controller registers */ +wm 32 0x021B001C 0x00008000 +wm 32 0x021B0800 0xA1390003 +/* Calibration values */ +wm 32 0x021B080C 0x00000000 +wm 32 0x021B083C 0x413B013B +wm 32 0x021B0848 0x4040373E +wm 32 0x021B0850 0x40405954 +wm 32 0x021B081C 0x33333333 +wm 32 0x021B0820 0x33333333 +wm 32 0x021B082C 0xf3333333 +wm 32 0x021B0830 0xf3333333 +/* END of calibration values */ +wm 32 0x021B08C0 0x00921012 +wm 32 0x021B08b8 0x00000800 + +/* MMDC init */ +wm 32 0x021B0004 0x0002002D +wm 32 0x021B0008 0x1b333030 +wm 32 0x021B000C 0x676B52F3 +wm 32 0x021B0010 0xB66D0B63 +wm 32 0x021B0014 0x01FF00DB +/* Consider reducing RALAT (currently set to 5) */ +wm 32 0x021B0018 0x00201740 +wm 32 0x021B001C 0x00008000 +wm 32 0x021B002C 0x000026D2 +wm 32 0x021B0030 0x006B1023 +wm 32 0x021B0040 0x00000047 +wm 32 0x021B0000 0x83180000 + +/* Mode registers writes for CS0 */ +wm 32 0x021B001C 0x02008032 +wm 32 0x021B001C 0x00008033 +wm 32 0x021B001C 0x00048031 +wm 32 0x021B001C 0x15208030 +wm 32 0x021B001C 0x04008040 + +/* Final DDR setup */ +wm 32 0x021B0020 0x00000800 +wm 32 0x021B0818 0x00000227 +wm 32 0x021B0004 0x0002552D +wm 32 0x021B0404 0x00011006 +wm 32 0x021B001C 0x00000000 diff --git a/arch/arm/boards/digi-ccimx6ulsom/lowlevel.c b/arch/arm/boards/digi-ccimx6ulsom/lowlevel.c new file mode 100644 index 0000000000..ac76a843ac --- /dev/null +++ b/arch/arm/boards/digi-ccimx6ulsom/lowlevel.c @@ -0,0 +1,32 @@ +#include <common.h> +#include <mach/generic.h> +#include <asm/barebox-arm.h> +#include <mach/esdctl.h> +#include <asm/cache.h> + + +extern char __dtb_z_imx6ul_ccimx6ulsbcpro_start[]; + +ENTRY_FUNCTION(start_imx6ul_ccimx6ulsbcpro, r0, r1, r2) +{ + void *fdt; + + imx6ul_cpu_lowlevel_init(); + + arm_setup_stack(0x00910000 - 8); + + arm_early_mmu_cache_invalidate(); + + relocate_to_current_adr(); + setup_c(); + barrier(); + + /* disable all watchdog powerdown counters */ + writew(0x0, 0x020bc008); + writew(0x0, 0x020c0008); + writew(0x0, 0x021e4008); + + fdt = __dtb_z_imx6ul_ccimx6ulsbcpro_start; + + imx6ul_barebox_entry(fdt); +} diff --git a/arch/arm/boards/zii-common/pn-fixup.h b/arch/arm/boards/zii-common/pn-fixup.h index 39b848bd00..925e8ad634 100644 --- a/arch/arm/boards/zii-common/pn-fixup.h +++ b/arch/arm/boards/zii-common/pn-fixup.h @@ -15,6 +15,8 @@ #ifndef __ZII_PN_FIXUP__ #define __ZII_PN_FIXUP__ +#include <linux/stddef.h> + struct zii_pn_fixup { const char *pn; void (*callback) (const struct zii_pn_fixup *fixup); diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net new file mode 100644 index 0000000000..4090c2f4a9 --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net @@ -0,0 +1,24 @@ +#!/bin/sh + +path="/mnt/tftp" + +# clear seat network config +global.linux.bootargs.rdu_network= + +global.bootm.image="${path}/${global.user}-linux-${global.hostname}" + +oftree="${path}/${global.user}-oftree-${global.hostname}" +if [ -f "${oftree}" ]; then + global.bootm.oftree="$oftree" +fi + +nfsroot="/home/${global.user}/nfsroot/${global.hostname}" + +ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip + +initramfs="${path}/${global.user}-initramfs-${global.hostname}" +if [ -f "${initramfs}" ]; then + global.bootm.initrd="$initramfs" +else + global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" +fi
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/nfs b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/nfs new file mode 100644 index 0000000000..4f9671f9cd --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/nfs @@ -0,0 +1,7 @@ +#!/bin/sh + +# clear seat network config +global.linux.bootargs.rdu_network= + +backlight0.brightness=0 +boot /mnt/nfs diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/rdu-default b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/rdu-default new file mode 100644 index 0000000000..f391d91eba --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/rdu-default @@ -0,0 +1,13 @@ +#!/bin/sh + +backlight0.brightness=0 +if [ "$bootsource" = "spi-nor" ]; then + boot mmc1 +else + detect mmc3 + if [ "$mmc3.boot" = "boot0" ]; then + boot mmc3.0 + else + boot mmc3.1 + fi +fi diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/network/eth0-discover b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/network/eth0-discover new file mode 100644 index 0000000000..00f3120115 --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/network/eth0-discover @@ -0,0 +1,4 @@ +#!/bin/sh + +# reset switch to clear DSA config +rave_reset_switch diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/autoboot_abort_key b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/autoboot_abort_key new file mode 100644 index 0000000000..55920c9a58 --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/autoboot_abort_key @@ -0,0 +1 @@ +ctrl-c
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/boot.default b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/boot.default index 3cfe9bafdc..9076a1e64e 100644 --- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/boot.default +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/boot.default @@ -1 +1 @@ -mmc1
\ No newline at end of file +rdu-default
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/dev.eth1.mode b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/dev.eth1.mode new file mode 100644 index 0000000000..87e7bdaaec --- /dev/null +++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/nv/dev.eth1.mode @@ -0,0 +1 @@ +disabled
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c index a5ac6f64c2..9672a69bfd 100644 --- a/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c +++ b/arch/arm/boards/zii-imx6q-rdu2/lowlevel.c @@ -271,11 +271,6 @@ static noinline void rdu2_sram_setup(void) enum bootsource bootsrc; int instance; - imx6_ungate_all_peripherals(); - - if (IS_ENABLED(CONFIG_DEBUG_LL)) - setup_uart(); - arm_setup_stack(0x00920000 - 8); relocate_to_current_adr(); setup_c(); @@ -296,6 +291,11 @@ ENTRY_FUNCTION(start_imx6_zii_rdu2, r0, r1, r2) { imx6_cpu_lowlevel_init(); + imx6_ungate_all_peripherals(); + + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + /* * When still running in SRAM, we need to setup the DRAM now and load * the remaining image. diff --git a/arch/arm/boards/zii-imx8mq-dev/Makefile b/arch/arm/boards/zii-imx8mq-dev/Makefile index 2995f06f0f..d0148b5067 100644 --- a/arch/arm/boards/zii-imx8mq-dev/Makefile +++ b/arch/arm/boards/zii-imx8mq-dev/Makefile @@ -1,2 +1,3 @@ obj-y += board.o lwl-y += lowlevel.o ddr_init.o ddrphy_train.o +bbenv-y += defaultenv-imx8mq-zii-dev diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c index 94e71f58ce..144adb9cef 100644 --- a/arch/arm/boards/zii-imx8mq-dev/board.c +++ b/arch/arm/boards/zii-imx8mq-dev/board.c @@ -4,7 +4,9 @@ * Author: Andrey Smirnov <andrew.smirnov@gmail.com> */ +#include <bootsource.h> #include <common.h> +#include <envfs.h> #include <init.h> #include <asm/memory.h> #include <linux/sizes.h> @@ -19,6 +21,13 @@ static int zii_imx8mq_dev_init(void) imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", 0); + if (bootsource_get_instance() == 0) + of_device_enable_path("/chosen/environment-emmc"); + else + of_device_enable_path("/chosen/environment-sd"); + + defaultenv_append_directory(defaultenv_imx8mq_zii_dev); + return 0; } device_initcall(zii_imx8mq_dev_init); diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net new file mode 100644 index 0000000000..4090c2f4a9 --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net @@ -0,0 +1,24 @@ +#!/bin/sh + +path="/mnt/tftp" + +# clear seat network config +global.linux.bootargs.rdu_network= + +global.bootm.image="${path}/${global.user}-linux-${global.hostname}" + +oftree="${path}/${global.user}-oftree-${global.hostname}" +if [ -f "${oftree}" ]; then + global.bootm.oftree="$oftree" +fi + +nfsroot="/home/${global.user}/nfsroot/${global.hostname}" + +ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip + +initramfs="${path}/${global.user}-initramfs-${global.hostname}" +if [ -f "${initramfs}" ]; then + global.bootm.initrd="$initramfs" +else + global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" +fi
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/nfs b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/nfs new file mode 100644 index 0000000000..cd3a545409 --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/nfs @@ -0,0 +1,6 @@ +#!/bin/sh + +# clear seat network config +global.linux.bootargs.rdu_network= + +boot /mnt/nfs diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/rdu-default b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/rdu-default new file mode 100644 index 0000000000..f5d8fe2125 --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/rdu-default @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$bootsource_instance" = "0" ]; then + boot mmc0 +else + boot mmc1 +fi diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/autoboot_abort_key b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/autoboot_abort_key new file mode 100644 index 0000000000..55920c9a58 --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/autoboot_abort_key @@ -0,0 +1 @@ +ctrl-c
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/boot.default b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/boot.default new file mode 100644 index 0000000000..9076a1e64e --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/boot.default @@ -0,0 +1 @@ +rdu-default
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/dev.eth1.mode b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/dev.eth1.mode new file mode 100644 index 0000000000..87e7bdaaec --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/nv/dev.eth1.mode @@ -0,0 +1 @@ +disabled
\ No newline at end of file diff --git a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/nv/dev.eth1.mode b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/nv/dev.eth1.mode new file mode 100644 index 0000000000..87e7bdaaec --- /dev/null +++ b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/nv/dev.eth1.mode @@ -0,0 +1 @@ +disabled
\ No newline at end of file |