diff options
Diffstat (limited to 'arch')
133 files changed, 1915 insertions, 764 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a54ad03445..7b7b0585ae 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -58,6 +58,7 @@ config ARCH_NOMADIK config ARCH_OMAP bool "TI OMAP" select HAS_DEBUG_LL + select GPIOLIB config ARCH_PXA bool "Intel/Marvell PXA based" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 8e660bea2b..855043aedf 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -92,6 +92,7 @@ board-$(CONFIG_MACH_FREESCALE_MX25_3STACK) := freescale-mx25-3-stack board-$(CONFIG_MACH_FREESCALE_MX35_3STACK) := freescale-mx35-3-stack board-$(CONFIG_MACH_IMX21ADS) := imx21ads board-$(CONFIG_MACH_IMX27ADS) := imx27ads +board-$(CONFIG_MACH_IMX233_OLINUXINO) := imx233-olinuxino board-$(CONFIG_MACH_MIOA701) := mioa701 board-$(CONFIG_MACH_MMCCPU) := mmccpu board-$(CONFIG_MACH_NOMADIK_8815NHK) := nhk8815 @@ -141,6 +142,7 @@ board-$(CONFIG_MACH_TOSHIBA_AC100) := toshiba-ac100 board-$(CONFIG_MACH_CCMX51) := ccxmx51 board-$(CONFIG_MACH_TINY210) := friendlyarm-tiny210 board-$(CONFIG_MACH_SABRELITE) := freescale-mx6-sabrelite +board-$(CONFIG_MACH_TX53) := karo-tx53 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) @@ -179,7 +181,7 @@ barebox.netx: $(KBUILD_BINARY) ifeq ($(machine-y),netx) KBUILD_TARGET := barebox.netx -KBUILD_BINARY := $(KBUILD_TARGET) +KBUILD_IMAGE := barebox.netx endif barebox.s5p: $(KBUILD_BINARY) @@ -187,7 +189,7 @@ barebox.s5p: $(KBUILD_BINARY) ifeq ($(CONFIG_ARCH_S5PCxx),y) KBUILD_TARGET := barebox.s5p -KBUILD_BINARY := $(KBUILD_TARGET) +KBUILD_IMAGE := barebox.s5p endif quiet_cmd_mlo ?= IFT $@ @@ -199,17 +201,31 @@ MLO: $(KBUILD_BINARY) ifeq ($(CONFIG_OMAP_BUILD_IFT),y) KBUILD_TARGET := MLO -KBUILD_BINARY := $(KBUILD_TARGET) +KBUILD_IMAGE := MLO endif -barebox.ubl: $(KBUILD_BINARY) - @echo " UBL " $@ - $(Q)scripts/mkublheader $< > barebox.ubl - $(Q)cat $< >> barebox.ubl +quiet_cmd_davinci_ubl_image = UBL-IMG $@ + cmd_davinci_ubl_image = set -e; \ + scripts/mkublheader $< > $@; \ + cat $< >> $@ + +barebox.ubl: $(KBUILD_BINARY) FORCE + $(call if_changed,davinci_ubl_image) ifeq ($(CONFIG_ARCH_DAVINCI),y) KBUILD_TARGET := barebox.ubl -KBUILD_BINARY := $(KBUILD_TARGET) +KBUILD_IMAGE := barebox.ubl +endif + +quiet_cmd_am35xx_spi_image = SPI-IMG $@ + cmd_am35xx_spi_image = scripts/mk-am35xx-spi-image $< > $@ + +barebox.spi: $(KBUILD_BINARY) FORCE + $(call if_changed,am35xx_spi_image) + +ifeq ($(CONFIG_OMAP_BUILD_SPI),y) +KBUILD_TARGET := barebox.spi +KBUILD_IMAGE := barebox.spi endif pbl := arch/arm/pbl @@ -219,7 +235,7 @@ zbarebox.S zbarebox.bin zbarebox: barebox.bin archclean: $(MAKE) $(clean)=$(pbl) -KBUILD_IMAGE := $(KBUILD_BINARY) +KBUILD_IMAGE ?= $(KBUILD_BINARY) archprepare: maketools maketools: diff --git a/arch/arm/boards/at91rm9200ek/env/config b/arch/arm/boards/at91rm9200ek/env/config index 735bb107aa..a3830cb31a 100644 --- a/arch/arm/boards/at91rm9200ek/env/config +++ b/arch/arm/boards/at91rm9200ek/env/config @@ -3,7 +3,7 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -dhcp_vendor_id=barebox-at91rm9200ek +global.dhcp.vendor_id=barebox-at91rm9200ek # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/at91sam9260ek/env/config b/arch/arm/boards/at91sam9260ek/env/config index 06b9fafb81..8e88186217 100644 --- a/arch/arm/boards/at91sam9260ek/env/config +++ b/arch/arm/boards/at91sam9260ek/env/config @@ -6,9 +6,9 @@ ip=dhcp-barebox if [ x$armlinux_architecture = x1099 ] then - dhcp_vendor_id=barebox-at91sam9260ek + global.dhcp.vendor_id=barebox-at91sam9260ek else - dhcp_vendor_id=barebox-at91sam9g20ek + global.dhcp.vendor_id=barebox-at91sam9g20ek fi # or set your networking parameters here diff --git a/arch/arm/boards/at91sam9261ek/env/config b/arch/arm/boards/at91sam9261ek/env/config index 820485dea8..7d855779ca 100644 --- a/arch/arm/boards/at91sam9261ek/env/config +++ b/arch/arm/boards/at91sam9261ek/env/config @@ -6,9 +6,9 @@ ip=dhcp-barebox if [ x$armlinux_architecture = x848 ] then - dhcp_vendor_id=barebox-at91sam9261ek + global.dhcp.vendor_id=barebox-at91sam9261ek else - dhcp_vendor_id=barebox-at91sam9g10ek + global.dhcp.vendor_id=barebox-at91sam9g10ek fi # or set your networking parameters here diff --git a/arch/arm/boards/at91sam9263ek/env/config b/arch/arm/boards/at91sam9263ek/env/config index a09bc26080..5125020a73 100644 --- a/arch/arm/boards/at91sam9263ek/env/config +++ b/arch/arm/boards/at91sam9263ek/env/config @@ -3,7 +3,7 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -dhcp_vendor_id=barebox-at91sam9263ek +global.dhcp.vendor_id=barebox-at91sam9263ek # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/at91sam9m10g45ek/env/config b/arch/arm/boards/at91sam9m10g45ek/env/config index 37a20e93f2..54ed2cb9df 100644 --- a/arch/arm/boards/at91sam9m10g45ek/env/config +++ b/arch/arm/boards/at91sam9m10g45ek/env/config @@ -3,7 +3,7 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -dhcp_vendor_id=barebox-at91sam9m10g45ek +global.dhcp.vendor_id=barebox-at91sam9m10g45ek # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/at91sam9x5ek/env/config b/arch/arm/boards/at91sam9x5ek/env/config index dafe875664..6a985cedc5 100644 --- a/arch/arm/boards/at91sam9x5ek/env/config +++ b/arch/arm/boards/at91sam9x5ek/env/config @@ -3,7 +3,7 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -dhcp_vendor_id=barebox-at91sam9x5ek +global.dhcp.vendor_id=barebox-at91sam9x5ek # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/chumby_falconwing/env/config b/arch/arm/boards/chumby_falconwing/env/config index bf48da614d..3839b40584 100644 --- a/arch/arm/boards/chumby_falconwing/env/config +++ b/arch/arm/boards/chumby_falconwing/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=falconwing +global.hostname=falconwing # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c index e454afd36c..522d2d783d 100644 --- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c +++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c @@ -23,6 +23,8 @@ #include <init.h> #include <mci.h> #include <io.h> +#include <net.h> +#include <sizes.h> #include <mach/clock.h> #include <mach/imx-regs.h> @@ -89,16 +91,19 @@ static int cfa10036_devices_init(void) armlinux_set_bootparams((void *)IMX_MEMORY_BASE + 0x100); armlinux_set_architecture(MACH_TYPE_CFA10036); - add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0, + add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, SZ_8K, IORESOURCE_MEM, &mci_pdata); + add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, SZ_8K, + IORESOURCE_MEM, NULL); + return 0; } device_initcall(cfa10036_devices_init); static int cfa10036_console_init(void) { - add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 8192, + add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, SZ_8K, IORESOURCE_MEM, NULL); return 0; diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board index ff3365d089..58e07e0403 100644 --- a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board @@ -1,11 +1,11 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/eukrea_cpuimx25/env/config b/arch/arm/boards/eukrea_cpuimx25/env/config index b6bf93f58f..63a85b27eb 100644 --- a/arch/arm/boards/eukrea_cpuimx25/env/config +++ b/arch/arm/boards/eukrea_cpuimx25/env/config @@ -5,7 +5,7 @@ otg_mode="device" # video : can be CMO-QVGA, URT-WVGA, DVI-VGA or DVI-SVGA video="CMO-QVGA" -hostname=eukrea-cpuimx25 +global.hostname=eukrea-cpuimx25 # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration @@ -24,16 +24,16 @@ rootfs_loc=nand # rootfs rootfs_type=ubifs -rootfsimage=$hostname/rootfs.$rootfs_type +rootfsimage=${global.hostname}/rootfs.$rootfs_type # kernel -kernelimage=$hostname/uImage-${hostname}.bin +kernelimage=${global.hostname}/uImage-${global.hostname}.bin # barebox and it's env -bareboximage=$hostname/barebox-${hostname}.bin -bareboxenvimage=$hostname/bareboxenv-${hostname}.bin +bareboximage=${global.hostname}/barebox-${global.hostname}.bin +bareboxenvimage=${global.hostname}/bareboxenv-${global.hostname}.bin -nfsroot="$eth0.serverip:/srv/nfs/$hostname" +nfsroot="$eth0.serverip:/srv/nfs/${global.hostname}" autoboot_timeout=1 @@ -42,7 +42,7 @@ bootargs="console=ttymxc0,115200 otg_mode=$otg_mode video=imxfb:$video" nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)" rootfs_mtdblock_nand=3 nand_device="mxc_nand" -ubiroot="$hostname-rootfs" +ubiroot="${global.hostname}-rootfs" device_type="nand" # set a fancy prompt (if support is compiled in) diff --git a/arch/arm/boards/eukrea_cpuimx27/env/bin/init b/arch/arm/boards/eukrea_cpuimx27/env/bin/init index f84ace9324..cd74974e25 100644 --- a/arch/arm/boards/eukrea_cpuimx27/env/bin/init +++ b/arch/arm/boards/eukrea_cpuimx27/env/bin/init @@ -17,11 +17,11 @@ if [ -e /dev/nand0 ]; then fi if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board index 89fd9a90db..2a07a8425a 100644 --- a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board @@ -1,12 +1,12 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 gpio_set_value 1 1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 gpio_set_value 1 1 fi diff --git a/arch/arm/boards/eukrea_cpuimx35/env/config b/arch/arm/boards/eukrea_cpuimx35/env/config index 01cbfe9b06..50d33a46c3 100644 --- a/arch/arm/boards/eukrea_cpuimx35/env/config +++ b/arch/arm/boards/eukrea_cpuimx35/env/config @@ -5,7 +5,7 @@ otg_mode="device" # video : can be CMO-QVGA, URT-WVGA, DVI-VGA or DVI-SVGA video="CMO-QVGA" -hostname=eukrea-cpuimx35 +global.hostname=eukrea-cpuimx35 # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration @@ -24,16 +24,16 @@ rootfs_loc=nand # rootfs rootfs_type=ubifs -rootfsimage=$hostname/rootfs.$rootfs_type +rootfsimage=${global.hostname}/rootfs.$rootfs_type # kernel -kernelimage=$hostname/uImage-${hostname}.bin +kernelimage=${global.hostname}/uImage-${global.hostname}.bin # barebox and it's env -bareboximage=$hostname/barebox-${hostname}.bin -bareboxenvimage=$hostname/bareboxenv-${hostname}.bin +bareboximage=${global.hostname}/barebox-${global.hostname}.bin +bareboxenvimage=${global.hostname}/bareboxenv-${global.hostname}.bin -nfsroot="$eth0.serverip:/srv/nfs/$hostname" +nfsroot="$eth0.serverip:/srv/nfs/${global.hostname}" autoboot_timeout=1 @@ -42,7 +42,7 @@ bootargs="console=ttymxc0,115200 otg_mode=$otg_mode video=mx3fb:$video" nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)" rootfs_mtdblock_nand=3 nand_device="mxc_nand" -ubiroot="$hostname-rootfs" +ubiroot="${global.hostname}-rootfs" device_type="nand" # set a fancy prompt (if support is compiled in) diff --git a/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board index cb624e57aa..0af65822f1 100644 --- a/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board @@ -1,12 +1,12 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 gpio_set_value 1 1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 gpio_set_value 1 1 fi diff --git a/arch/arm/boards/eukrea_cpuimx51/env/config b/arch/arm/boards/eukrea_cpuimx51/env/config index 163d026158..17f8337f73 100644 --- a/arch/arm/boards/eukrea_cpuimx51/env/config +++ b/arch/arm/boards/eukrea_cpuimx51/env/config @@ -8,7 +8,7 @@ video="CMO-QVGA" # screen type : can be 'tft' or 'dvi' screen_type="tft" -hostname=eukrea-cpuimx51 +global.hostname=eukrea-cpuimx51 # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration @@ -27,16 +27,16 @@ rootfs_loc=nand # rootfs rootfs_type=ubifs -rootfsimage=$hostname/rootfs.$rootfs_type +rootfsimage=${global.hostname}/rootfs.$rootfs_type # kernel -kernelimage=$hostname/uImage-${hostname}.bin +kernelimage=${global.hostname}/uImage-${global.hostname}.bin # barebox and it's env -bareboximage=$hostname/barebox-${hostname}.bin -bareboxenvimage=$hostname/bareboxenv-${hostname}.bin +bareboximage=${global.hostname}/barebox-${global.hostname}.bin +bareboxenvimage=${global.hostname}/bareboxenv-${global.hostname}.bin -nfsroot="$eth0.serverip:/srv/nfs/$hostname" +nfsroot="$eth0.serverip:/srv/nfs/${global.hostname}" autoboot_timeout=1 @@ -45,7 +45,7 @@ bootargs="console=ttymxc0,115200 otg_mode=$otg_mode video=$video screen_type=$sc nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)" rootfs_mtdblock_nand=3 nand_device="mxc_nand" -ubiroot="$hostname-rootfs" +ubiroot="${global.hostname}-rootfs" device_type="nand" # set a fancy prompt (if support is compiled in) diff --git a/arch/arm/boards/freescale-mx28-evk/env/config b/arch/arm/boards/freescale-mx28-evk/env/config index 3951c5bd06..4e2c90d4b1 100644 --- a/arch/arm/boards/freescale-mx28-evk/env/config +++ b/arch/arm/boards/freescale-mx28-evk/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=mx28-evk +global.hostname=mx28-evk #user= # use 'dhcp' to do dhcp in barebox and in kernel @@ -24,21 +24,21 @@ rootfs_loc=net rootfs_type=ext2 # where is the rootfs in case of 'rootfs_loc=disk' (linux name) rootfs_part_linux_dev=mmcblk0p4 -rootfsimage=rootfs-${hostname}.$rootfs_type +rootfsimage=rootfs-${global.hostname}.$rootfs_type # where is the kernel image in case of 'kernel_loc=disk' kernel_part=disk0.2 -kernelimage=zImage-$hostname -bareboximage=barebox-${hostname}.bin -bareboxenvimage=barebox-${hostname}.bin +kernelimage=zImage-${global.hostname} +bareboximage=barebox-${global.hostname}.bin +bareboxenvimage=barebox-${global.hostname}.bin if [ -n $user ]; then bareboximage="$user"-"$bareboximage" bareboxenvimage="$user"-"$bareboxenvimage" kernelimage="$user"-"$kernelimage" rootfsimage="$user"-"$rootfsimage" - nfsroot="/home/$user/nfsroot/$hostname" + nfsroot="/home/$user/nfsroot/${global.hostname}" else nfsroot="/path/to/nfs/root" fi diff --git a/arch/arm/boards/freescale-mx35-3-stack/env/config b/arch/arm/boards/freescale-mx35-3-stack/env/config index 171ae8c9bf..122c0fcaba 100644 --- a/arch/arm/boards/freescale-mx35-3-stack/env/config +++ b/arch/arm/boards/freescale-mx35-3-stack/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=mx35-3stack +global.hostname=mx35-3stack eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/freescale-mx53-loco/env/config b/arch/arm/boards/freescale-mx53-loco/env/config index bceddafa97..2ab126828b 100644 --- a/arch/arm/boards/freescale-mx53-loco/env/config +++ b/arch/arm/boards/freescale-mx53-loco/env/config @@ -1,13 +1,13 @@ #!/bin/sh -hostname=loco +global.hostname=loco eth0.serverip= user= # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp -dhcp_vendor_id=barebox-mx53-loco +global.dhcp.vendor_id=barebox-mx53-loco # or set your networking parameters here #eth0.ipaddr=a.b.c.d @@ -22,16 +22,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/freescale-mx53-smd/env/config b/arch/arm/boards/freescale-mx53-smd/env/config index d2afb291e8..d92beb9ee4 100644 --- a/arch/arm/boards/freescale-mx53-smd/env/config +++ b/arch/arm/boards/freescale-mx53-smd/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=loco +global.hostname=loco eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/freescale-mx6-arm2/board.c b/arch/arm/boards/freescale-mx6-arm2/board.c index 0b7aab8044..ccc73182db 100644 --- a/arch/arm/boards/freescale-mx6-arm2/board.c +++ b/arch/arm/boards/freescale-mx6-arm2/board.c @@ -21,7 +21,7 @@ #include <asm/armlinux.h> #include <generated/mach-types.h> #include <partition.h> -#include <miidev.h> +#include <linux/phy.h> #include <asm/io.h> #include <asm/mmu.h> #include <mach/generic.h> @@ -99,50 +99,39 @@ static int arm2_mem_init(void) } mem_initcall(arm2_mem_init); -static struct fec_platform_data fec_info = { - .xcv_type = RGMII, - .phy_addr = 0, -}; - -static int mx6_rgmii_rework(void) +static void mx6_rgmii_rework(struct phy_device *dev) { - struct mii_device *mdev; u16 val; - mdev = mii_open("phy0"); - if (!mdev) { - printf("unable to open phy0\n"); - return -ENODEV; - } - /* To enable AR8031 ouput a 125MHz clk from CLK_25M */ - mii_write(mdev, mdev->address, 0xd, 0x7); - mii_write(mdev, mdev->address, 0xe, 0x8016); - mii_write(mdev, mdev->address, 0xd, 0x4007); + phy_write(dev, 0xd, 0x7); + phy_write(dev, 0xe, 0x8016); + phy_write(dev, 0xd, 0x4007); - val = mii_read(mdev, mdev->address, 0xe); + val = phy_read(dev, 0xe); val &= 0xffe3; val |= 0x18; - mii_write(mdev, mdev->address, 0xe, val); + phy_write(dev, 0xe, val); /* introduce tx clock delay */ - mii_write(mdev, mdev->address, 0x1d, 0x5); + phy_write(dev, 0x1d, 0x5); - val = mii_read(mdev, mdev->address, 0x1e); + val = phy_read(dev, 0x1e); val |= 0x0100; - mii_write(mdev, mdev->address, 0x1e, val); - - mii_close(mdev); - - return 0; + phy_write(dev, 0x1e, val); } +static struct fec_platform_data fec_info = { + .xcv_type = RGMII, + .phy_init = mx6_rgmii_rework, + .phy_addr = 0, +}; + static int arm2_devices_init(void) { imx6_add_mmc3(NULL); imx6_add_fec(&fec_info); - mx6_rgmii_rework(); armlinux_set_bootparams((void *)0x10000100); armlinux_set_architecture(3837); diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c index 2d3c5d243b..25402d7c9c 100644 --- a/arch/arm/boards/freescale-mx6-sabrelite/board.c +++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c @@ -23,7 +23,7 @@ #include <asm/armlinux.h> #include <generated/mach-types.h> #include <partition.h> -#include <miidev.h> +#include <linux/phy.h> #include <asm/io.h> #include <asm/mmu.h> #include <mach/generic.h> @@ -131,38 +131,27 @@ static int sabrelite_mem_init(void) } mem_initcall(sabrelite_mem_init); -static struct fec_platform_data fec_info = { - .xcv_type = RGMII, - .phy_addr = 6, -}; - -int mx6_rgmii_rework(void) +static void mx6_rgmii_rework(struct phy_device *dev) { - struct mii_device *mdev; - - mdev = mii_open("phy0"); - if (!mdev) { - printf("unable to open phy0\n"); - return -ENODEV; - } - - mii_write(mdev, mdev->address, 0x09, 0x0f00); + phy_write(dev, 0x09, 0x0f00); /* do same as linux kernel */ /* min rx data delay */ - mii_write(mdev, mdev->address, 0x0b, 0x8105); - mii_write(mdev, mdev->address, 0x0c, 0x0000); + phy_write(dev, 0x0b, 0x8105); + phy_write(dev, 0x0c, 0x0000); /* max rx/tx clock delay, min rx/tx control delay */ - mii_write(mdev, mdev->address, 0x0b, 0x8104); - mii_write(mdev, mdev->address, 0x0c, 0xf0f0); - mii_write(mdev, mdev->address, 0x0b, 0x104); - - mii_close(mdev); - - return 0; + phy_write(dev, 0x0b, 0x8104); + phy_write(dev, 0x0c, 0xf0f0); + phy_write(dev, 0x0b, 0x104); } +static struct fec_platform_data fec_info = { + .xcv_type = RGMII, + .phy_init = mx6_rgmii_rework, + .phy_addr = 6, +}; + static int sabrelite_ksz9021rn_setup(void) { mxc_iomux_v3_setup_multiple_pads(sabrelite_enet_pads, ARRAY_SIZE(sabrelite_enet_pads)); @@ -261,7 +250,6 @@ static int sabrelite_devices_init(void) sabrelite_ksz9021rn_setup(); imx6_iim_register_fec_ethaddr(); imx6_add_fec(&fec_info); - mx6_rgmii_rework(); sabrelite_ehci_init(); diff --git a/arch/arm/boards/friendlyarm-mini2440/env/config b/arch/arm/boards/friendlyarm-mini2440/env/config index 77cc34f575..69d431a4ac 100644 --- a/arch/arm/boards/friendlyarm-mini2440/env/config +++ b/arch/arm/boards/friendlyarm-mini2440/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=mini2440 +global.hostname=mini2440 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-${hostname}.${rootfs_type} +rootfsimage=root-${global.hostname}.${rootfs_type} -kernelimage=zImage-${hostname} -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="${user}"-"${kernelimage}" - nfsroot="${eth0.serverip}:/home/${user}/nfsroot/${hostname}" + nfsroot="${eth0.serverip}:/home/${user}/nfsroot/${global.hostname}" rootfsimage="${user}"-"${rootfsimage}" else nfsroot="${eth0.serverip}:/path/to/nfs/root" diff --git a/arch/arm/boards/guf-cupid/env/config b/arch/arm/boards/guf-cupid/env/config index 1be875d048..17b11a1943 100644 --- a/arch/arm/boards/guf-cupid/env/config +++ b/arch/arm/boards/guf-cupid/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=cupid +global.hostname=cupid eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/guf-neso/env/config b/arch/arm/boards/guf-neso/env/config index 3013728263..1758c91454 100644 --- a/arch/arm/boards/guf-neso/env/config +++ b/arch/arm/boards/guf-neso/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=guf-neso +global.hostname=guf-neso eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/imx233-olinuxino/Makefile b/arch/arm/boards/imx233-olinuxino/Makefile new file mode 100644 index 0000000000..6d71450edb --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/Makefile @@ -0,0 +1 @@ +obj-y = imx23-olinuxino.o diff --git a/arch/arm/boards/imx233-olinuxino/config.h b/arch/arm/boards/imx233-olinuxino/config.h new file mode 100644 index 0000000000..87d9e2f476 --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/config.h @@ -0,0 +1,21 @@ +/* + * 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, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _CONFIG_H_ +# define _CONFIG_H_ + +#endif /* _CONFIG_H_ */ diff --git a/arch/arm/boards/imx233-olinuxino/env/bin/boot b/arch/arm/boards/imx233-olinuxino/env/bin/boot new file mode 100644 index 0000000000..60dd93f297 --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/env/bin/boot @@ -0,0 +1,32 @@ +#!/bin/sh + +. /env/config + +if [ x$1 = xdisk ]; then + rootfs_loc=disk + kernel_loc=disk +elif [ x$1 = xnet ]; then + rootfs_loc=net + kernel_loc=net +fi + +if [ x$ip = xdhcp ]; then + bootargs="$bootargs ip=dhcp" +elif [ x$ip = xnone ]; then + bootargs="$bootargs ip=none" +else + bootargs="$bootargs ip=$eth0.ipaddr::$eth0.gateway:$eth0.netmask:::" +fi + +if [ x$rootfs_loc = xdisk ]; then + bootargs="$bootargs noinitrd rootfstype=$rootfs_type root=/dev/$rootfs_part" +elif [ x$rootfs_loc = xnet ]; then + bootargs="$bootargs root=/dev/nfs nfsroot=$nfsroot,v3,tcp noinitrd" +elif [ x$rootfs_loc = xinitrd ]; then + bootargs="$bootargs root=/dev/ram0 rdinit=/sbin/init" +fi + + +bootm -o $oftree_loc/imx23-olinuxino.dtb /dev/$kernel_part + +echo "Booting failed. Correct setup of 'kernel_part'?" diff --git a/arch/arm/boards/imx233-olinuxino/env/bin/init b/arch/arm/boards/imx233-olinuxino/env/bin/init new file mode 100644 index 0000000000..3ed68f76c5 --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/env/bin/init @@ -0,0 +1,15 @@ +#!/bin/sh + +PATH=/env/bin +export PATH + +. /env/config + +echo +echo -n "Hit any key to stop autoboot: " +timeout -a $autoboot_timeout +if [ $? != 0 ]; then + exit +fi + +boot diff --git a/arch/arm/boards/imx233-olinuxino/env/config b/arch/arm/boards/imx233-olinuxino/env/config new file mode 100644 index 0000000000..0e95373b19 --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/env/config @@ -0,0 +1,42 @@ +#!/bin/sh + +hostname=imx23-olinuxino + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=none + +# or set your networking parameters here (if a USB network adapter is attached) +#eth0.ipaddr=a.b.c.d +#eth0.netmask=a.b.c.d +#eth0.gateway=a.b.c.d +#eth0.serverip=a.b.c.d + +# can be either 'net' or 'disk' +kernel_loc=disk + +# can be either 'net', or 'disk' or 'initrd' +rootfs_loc=disk + +# can be any regular filesystem like ext2, ext3, reiserfs in case of 'rootfs_loc=disk' +rootfs_type=ext3 + +# Where is the rootfs in case of 'rootfs_loc=disk' +rootfs_part=mmcblk0p4 + +# Where is the rootfs in case of 'rootfs_loc=net' +nfsroot=FIXME + +# Where to get the kernel image in case of 'kernel_loc=disk' +kernel_part=disk0.2 + +# Where to get the device tree image in case of 'kernel_loc=disk' +oftree_loc=env/oftree + +# base kernel parameter +bootargs="console=ttyAMA0,115200 rw rootwait" + +autoboot_timeout=2 + +# set a fancy prompt (if support is compiled in) +PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m " diff --git a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c new file mode 100644 index 0000000000..04826388d4 --- /dev/null +++ b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c @@ -0,0 +1,254 @@ +/* + * (C) Copyright 2012 Fadil Berisha, <fadil.r.berisha@gmail.com> + * based on falconwing.c & mx23-evk.c + * + * (C) Copyright 2010 Juergen Beisert - Pengutronix + * (C) Copyright 2011 Wolfram Sang - 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, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <init.h> +#include <gpio.h> +#include <environment.h> +#include <errno.h> +#include <mci.h> +#include <asm/armlinux.h> +#include <usb/ehci.h> +#include <mach/usb.h> +#include <generated/mach-types.h> +#include <mach/imx-regs.h> +#include <mach/clock.h> +#include <mach/mci.h> + +static struct mxs_mci_platform_data mci_pdata = { + .caps = MMC_MODE_4BIT | MMC_MODE_HS | MMC_MODE_HS_52MHz, + .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, /* fixed to 3.3 V */ + .f_min = 400000, +}; + +static const uint32_t pad_setup[] = { + /* debug port */ + PWM1_DUART_TX | STRENGTH(S4MA), /* PWM0/DUART_TXD - U_DEBUG PIN 2 */ + PWM0_DUART_RX | STRENGTH(S4MA), /* PWM0/DUART_RXD - U_DEBUG PIN 1 */ + + /* auart */ + I2C_SDA_AUART1_RX | STRENGTH(S4MA), + I2C_CLK_AUART1_TX | STRENGTH(S4MA), + + /* lcd */ + LCD_D17 | STRENGTH(S12MA), /*PIN18/LCD_D17 - GPIO PIN 3 */ + LCD_D16 | STRENGTH(S12MA), + LCD_D15 | STRENGTH(S12MA), + LCD_D14 | STRENGTH(S12MA), + LCD_D13 | STRENGTH(S12MA), + LCD_D12 | STRENGTH(S12MA), + LCD_D11 | STRENGTH(S12MA), + LCD_D10 | STRENGTH(S12MA), + LCD_D9 | STRENGTH(S12MA), + LCD_D8 | STRENGTH(S12MA), + LCD_D7 | STRENGTH(S12MA), + LCD_D6 | STRENGTH(S12MA), + LCD_D5 | STRENGTH(S12MA), + LCD_D4 | STRENGTH(S12MA), + LCD_D3 | STRENGTH(S12MA), + LCD_D2 | STRENGTH(S12MA), /* PIN3/LCD_D02 - GPIO PIN 31*/ + LCD_D1 | STRENGTH(S12MA), /* PIN2/LCD_D01 - GPIO PIN 33*/ + LCD_D0 | STRENGTH(S12MA), /* PIN1/LCD_D00 - GPIO PIN 35*/ + LCD_CS, /* PIN26/LCD_CS - GPIO PIN 20*/ + LCD_RS, /* PIN25/LCD_RS - GPIO PIN 18*/ + LCD_WR, /* PIN24/LCD_WR - GPIO PIN 16*/ + LCD_RESET, /* PIN23/LCD_DISP - GPIO PIN 14*/ + LCD_ENABE | STRENGTH(S12MA), /* PIN22/LCD_EN/I2C_SCL - GPIO PIN 12*/ + LCD_VSYNC | STRENGTH(S12MA), /* PIN21/LCD_HSYNC/I2C_SDA- GPIO PIN 10*/ + LCD_HSYNC | STRENGTH(S12MA), /* PIN20/LCD_VSYNC - GPIO PIN 8*/ + LCD_DOTCLOCK | STRENGTH(S12MA), /* PIN19/LCD_DOTCLK - GPIO PIN 6*/ + + + /* SD card interface */ + SSP1_DATA0 | PULLUP(1), + SSP1_DATA1 | PULLUP(1), + SSP1_DATA2 | PULLUP(1), + SSP1_DATA3 | PULLUP(1), + SSP1_SCK, + SSP1_CMD | PULLUP(1), + SSP1_DETECT | PULLUP(1), + + /* led */ + SSP1_DETECT_GPIO | GPIO_OUT | GPIO_VALUE(1), + + /* gpio - USB hub LAN9512-JZX*/ + GPMI_ALE_GPIO | GPIO_OUT | GPIO_VALUE(1), +}; + +static int imx23_olinuxino_mem_init(void) +{ + arm_add_mem_device("ram0", IMX_MEMORY_BASE, 64 * 1024 * 1024); + + return 0; +} +mem_initcall(imx23_olinuxino_mem_init); + +static void olinuxino_init_usb(void) +{ + + imx23_usb_phy_enable(); + + add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, IMX_USB_BASE, NULL); +} + +/** + * Try to register an environment storage on the attached MCI card + * @return 0 on success + * + * We rely on the existence of a usable SD card, already attached to + * our system, to get something like a persistent memory for our environment. + * If this SD card is also the boot media, we can use the second partition + * for our environment purpose (if present!). + */ +static int register_persistant_environment(void) +{ + struct cdev *cdev; + + /* + * The imx23-olinuxino only has one MCI card socket. + * So, we expect its name as "disk0". + */ + cdev = cdev_by_name("disk0"); + if (cdev == NULL) { + pr_err("No MCI card preset\n"); + return -ENODEV; + } + + + + /* MCI card is present, also a useable partition on it? */ + cdev = cdev_by_name("disk0.1"); + if (cdev == NULL) { + pr_err("No second partition available\n"); + pr_info("Please create at least a second partition with" + " 256 kiB...512 kiB in size (your choice)\n"); + return -ENODEV; + } + + /* use the full partition as our persistent environment storage */ + return devfs_add_partition("disk0.1", 0, cdev->size, + DEVFS_PARTITION_FIXED, "env0"); +} + + +static int imx23_olinuxino_devices_init(void) +{ + int i, rc; + + + /* initizalize gpios */ + for (i = 0; i < ARRAY_SIZE(pad_setup); i++) + imx_gpio_mode(pad_setup[i]); + + armlinux_set_bootparams((void *)IMX_MEMORY_BASE + 0x100); + armlinux_set_architecture(MACH_TYPE_IMX233_OLINUXINO); + + /* enable IOCLK to run at the PLL frequency */ + imx_set_ioclk(480000000); + + /* run the SSP unit clock at 100,000 kHz */ + imx_set_sspclk(0, 100000000, 1); + + add_generic_device("mxs_mci", DEVICE_ID_DYNAMIC, NULL, IMX_SSP1_BASE, + 0x8000, IORESOURCE_MEM, &mci_pdata); + + olinuxino_init_usb(); + + rc = register_persistant_environment(); + if (rc != 0) + printf("Cannot create the 'env0' persistant " + "environment storage (%d)\n", rc); + + return 0; +} + +device_initcall(imx23_olinuxino_devices_init); + +static int imx23_olinuxino_console_init(void) +{ + add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 8192, + IORESOURCE_MEM, NULL); + + return 0; +} + +console_initcall(imx23_olinuxino_console_init); + +/** @page olinuxino Olimex.ltd's i.MX23 evaluation kit + +This CPU card is based on an i.MX23 CPU. The card is shipped with: + +- 64 MiB synchronous dynamic RAM (mobile DDR type) + + +Memory layout when @b barebox is running: + +- 0x40000000 start of SDRAM +- 0x40000100 start of kernel's boot parameters + - below malloc area: stack area + - below barebox: malloc area +- 0x42000000 start of @b barebox + +@section get_imx23_olinuxino_binary How to get the bootloader binary image: + +Using the default configuration: + +@verbatim +make ARCH=arm imx23_olinuxino_defconfig +@endverbatim + +Build the bootloader binary image: + +@verbatim +make ARCH=arm CROSS_COMPILE=armv5compiler +@endverbatim + +@note replace the armv5compiler with your ARM v5 cross compiler. + +@section imx233-olinuxino How to prepare an MCI card to boot +the imx233-olinuxino with barebox + +- Create four primary partitions on the MCI card + - the first one for the bootlets (about 256 kiB) + - the second one for the persistant environment + (size is up to you, at least 256k) + - the third one for the kernel (2 MiB ... 4 MiB in size) + - the 4th one for the root filesystem which can fill the + rest of the available space + +- Mark the first partition with the partition ID "53" and copy the bootlets + into this partition (currently not part of @b barebox!). + +- @b barebox expect device tree blob file imx23-olinuxino.dtb + into directory env/oftree. At compile time, copy blob file into directory + arch/arm/boards/imx233-olinuxino/env/oftree/. + +- Copy the default @b barebox environment into the second partition + (no filesystem required). + +- Copy the kernel into the third partition (no filesystem required). + +- Create the root filesystem in the 4th partition. You may copy an + image into this partition or you can do it in the classic way: + mkfs on it, mount it and copy all required data and programs into it. +*/ diff --git a/arch/arm/boards/karo-tx25/env/bin/init_board b/arch/arm/boards/karo-tx25/env/bin/init_board index b17c55d445..1f35c961dc 100644 --- a/arch/arm/boards/karo-tx25/env/bin/init_board +++ b/arch/arm/boards/karo-tx25/env/bin/init_board @@ -1,6 +1,6 @@ if [ -e /dev/fb0 -a -e /env/splash.bmp ]; then - bmp /env/splash.bmp + splash /env/splash.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/karo-tx25/env/config b/arch/arm/boards/karo-tx25/env/config index 28a5e7f27c..87beb6d64b 100644 --- a/arch/arm/boards/karo-tx25/env/config +++ b/arch/arm/boards/karo-tx25/env/config @@ -1,5 +1,5 @@ -hostname=tx25 +global.hostname=tx25 baseboard=tx28stk5 user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/karo-tx28/env/config b/arch/arm/boards/karo-tx28/env/config index b5222e99dc..52593761a7 100644 --- a/arch/arm/boards/karo-tx28/env/config +++ b/arch/arm/boards/karo-tx28/env/config @@ -1,7 +1,7 @@ # # -hostname=tx28 +global.hostname=tx28 baseboard=tx28stk5 # use 'dhcp' to do dhcp in barebox and in kernel @@ -22,16 +22,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/karo-tx53/Makefile b/arch/arm/boards/karo-tx53/Makefile new file mode 100644 index 0000000000..b56ce7f50d --- /dev/null +++ b/arch/arm/boards/karo-tx53/Makefile @@ -0,0 +1,2 @@ +obj-y += board.o +obj-y += flash_header.o diff --git a/arch/arm/boards/karo-tx53/board.c b/arch/arm/boards/karo-tx53/board.c new file mode 100644 index 0000000000..c8509bebcb --- /dev/null +++ b/arch/arm/boards/karo-tx53/board.c @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2012 Sascha Hauer, 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. + * + */ +#include <common.h> +#include <environment.h> +#include <fcntl.h> +#include <fec.h> +#include <fs.h> +#include <init.h> +#include <nand.h> +#include <net.h> +#include <partition.h> +#include <sizes.h> + +#include <generated/mach-types.h> + +#include <mach/imx-regs.h> +#include <mach/iomux-mx53.h> +#include <mach/devices-imx53.h> +#include <mach/generic.h> +#include <mach/gpio.h> +#include <mach/imx-nand.h> +#include <mach/iim.h> +#include <mach/imx5.h> + +#include <asm/armlinux.h> +#include <io.h> +#include <asm/mmu.h> + +static struct fec_platform_data fec_info = { + .xcv_type = RMII, +}; + +static iomux_v3_cfg_t tx53_pads[] = { + /* UART1 */ + MX53_PAD_PATA_DIOW__UART1_TXD_MUX, + MX53_PAD_PATA_DMACK__UART1_RXD_MUX, + + MX53_PAD_PATA_DMARQ__UART2_TXD_MUX, + MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX, + + MX53_PAD_PATA_CS_0__UART3_TXD_MUX, + MX53_PAD_PATA_CS_1__UART3_RXD_MUX, + + /* setup FEC PHY pins for GPIO function */ + MX53_PAD_FEC_REF_CLK__GPIO1_23, + MX53_PAD_FEC_MDC__GPIO1_31, + MX53_PAD_FEC_MDIO__GPIO1_22, + MX53_PAD_FEC_RXD0__GPIO1_27, + MX53_PAD_FEC_RXD1__GPIO1_26, + MX53_PAD_FEC_RX_ER__GPIO1_24, + MX53_PAD_FEC_TX_EN__GPIO1_28, + MX53_PAD_FEC_TXD0__GPIO1_30, + MX53_PAD_FEC_TXD1__GPIO1_29, + MX53_PAD_FEC_CRS_DV__GPIO1_25, + + /* FEC PHY reset */ + MX53_PAD_PATA_DA_0__GPIO7_6, + /* FEC PHY power */ + MX53_PAD_EIM_D20__GPIO3_20, + + /* SD1 */ + MX53_PAD_SD1_CMD__ESDHC1_CMD, + MX53_PAD_SD1_CLK__ESDHC1_CLK, + MX53_PAD_SD1_DATA0__ESDHC1_DAT0, + MX53_PAD_SD1_DATA1__ESDHC1_DAT1, + MX53_PAD_SD1_DATA2__ESDHC1_DAT2, + MX53_PAD_SD1_DATA3__ESDHC1_DAT3, + + /* SD1_CD */ + MX53_PAD_EIM_D24__GPIO3_24, + + MX53_PAD_GPIO_3__I2C3_SCL, + MX53_PAD_GPIO_6__I2C3_SDA, + + MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12, + MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13, + MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14, + MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15, + MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16, + MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17, + MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18, + MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19, + MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC, + MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC, + MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK, +}; + +static int tx53_mem_init(void) +{ + arm_add_mem_device("ram0", 0x70000000, SZ_1G); + + return 0; +} +mem_initcall(tx53_mem_init); + +#define TX53_SD1_CD IMX_GPIO_NR(3, 24) + +static struct esdhc_platform_data tx53_sd1_data = { + .cd_gpio = TX53_SD1_CD, + .cd_type = ESDHC_CD_GPIO, + .wp_type = ESDHC_WP_NONE, +}; + +struct imx_nand_platform_data nand_info = { + .width = 1, + .hw_ecc = 1, + .flash_bbt = 1, +}; + +#define FEC_POWER_GPIO IMX_GPIO_NR(3, 20) +#define FEC_RESET_GPIO IMX_GPIO_NR(7, 6) + +static struct tx53_fec_gpio_setup { + iomux_v3_cfg_t pad; + unsigned gpio:9, + dir:1, + level:1; +} tx53_fec_gpios[] = { + { MX53_PAD_PATA_DA_0__GPIO7_6, FEC_RESET_GPIO, 1, 0, }, /* PHY reset */ + { MX53_PAD_EIM_D20__GPIO3_20, FEC_POWER_GPIO, 1, 1, }, /* PHY power enable */ + { MX53_PAD_FEC_REF_CLK__GPIO1_23, IMX_GPIO_NR(1, 23), 0, }, /* ENET_CLK */ + { MX53_PAD_FEC_MDC__GPIO1_31, IMX_GPIO_NR(1, 31), 1, 0, }, /* MDC */ + { MX53_PAD_FEC_MDIO__GPIO1_22, IMX_GPIO_NR(1, 22), 1, 0, }, /* MDIO */ + { MX53_PAD_FEC_RXD0__GPIO1_27, IMX_GPIO_NR(1, 27), 1, 1, }, /* Mode0/RXD0 */ + { MX53_PAD_FEC_RXD1__GPIO1_26, IMX_GPIO_NR(1, 26), 1, 1, }, /* Mode1/RXD1 */ + { MX53_PAD_FEC_RX_ER__GPIO1_24, IMX_GPIO_NR(1, 24), 0, }, /* RX_ER */ + { MX53_PAD_FEC_TX_EN__GPIO1_28, IMX_GPIO_NR(1, 28), 1, 0, }, /* TX_EN */ + { MX53_PAD_FEC_TXD0__GPIO1_30, IMX_GPIO_NR(1, 30), 1, 0, }, /* TXD0 */ + { MX53_PAD_FEC_TXD1__GPIO1_29, IMX_GPIO_NR(1, 29), 1, 0, }, /* TXD1 */ + { MX53_PAD_FEC_CRS_DV__GPIO1_25, IMX_GPIO_NR(1, 25), 1, 1, }, /* Mode2/CRS_DV */ +}; + +static iomux_v3_cfg_t tx53_fec_pads[] = { + MX53_PAD_FEC_REF_CLK__FEC_TX_CLK, + MX53_PAD_FEC_MDC__FEC_MDC, + MX53_PAD_FEC_MDIO__FEC_MDIO, + MX53_PAD_FEC_RXD0__FEC_RDATA_0, + MX53_PAD_FEC_RXD1__FEC_RDATA_1, + MX53_PAD_FEC_RX_ER__FEC_RX_ER, + MX53_PAD_FEC_TX_EN__FEC_TX_EN, + MX53_PAD_FEC_TXD0__FEC_TDATA_0, + MX53_PAD_FEC_TXD1__FEC_TDATA_1, + MX53_PAD_FEC_CRS_DV__FEC_RX_DV, +}; + +static inline void tx53_fec_init(void) +{ + int i; + + /* Configure LAN8700 pads as GPIO and set up + * necessary strap options for PHY + */ + for (i = 0; i < ARRAY_SIZE(tx53_fec_gpios); i++) { + struct tx53_fec_gpio_setup *gs = &tx53_fec_gpios[i]; + + if (gs->dir) + gpio_direction_output(gs->gpio, gs->level); + else + gpio_direction_input(gs->gpio); + + mxc_iomux_v3_setup_pad(gs->pad); + } + + /* + *Turn on phy power, leave in reset state + */ + gpio_set_value(FEC_POWER_GPIO, 1); + + /* + * Wait some time to let the phy activate the internal regulator + */ + mdelay(10); + + /* + * Deassert reset, phy latches the rest of bootstrap pins + */ + gpio_set_value(FEC_RESET_GPIO, 1); + + /* LAN7800 has an internal Power On Reset (POR) signal (OR'ed with + * the external RESET signal) which is deactivated 21ms after + * power on and latches the strap options. + * Delay for 22ms to ensure, that the internal POR is inactive + * before reconfiguring the strap pins. + */ + mdelay(22); + + /* + * The phy is ready, now configure imx51 pads for fec operation + */ + mxc_iomux_v3_setup_multiple_pads(tx53_fec_pads, + ARRAY_SIZE(tx53_fec_pads)); +} + +static int tx53_devices_init(void) +{ + imx53_iim_register_fec_ethaddr(); + tx53_fec_init(); + imx53_add_fec(&fec_info); + imx53_add_mmc0(&tx53_sd1_data); + imx53_add_nand(&nand_info); + + armlinux_set_bootparams((void *)0x70000100); + armlinux_set_architecture(MACH_TYPE_TX53); + + return 0; +} + +device_initcall(tx53_devices_init); + +static int tx53_part_init(void) +{ + devfs_add_partition("disk0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self0"); + devfs_add_partition("disk0", SZ_512K, SZ_1M, DEVFS_PARTITION_FIXED, "env0"); + + return 0; +} +late_initcall(tx53_part_init); + +static int tx53_console_init(void) +{ + mxc_iomux_v3_setup_multiple_pads(tx53_pads, ARRAY_SIZE(tx53_pads)); + + imx53_init_lowlevel(1000); + + imx53_add_uart0(); + return 0; +} +console_initcall(tx53_console_init); diff --git a/arch/arm/boards/karo-tx53/config.h b/arch/arm/boards/karo-tx53/config.h new file mode 100644 index 0000000000..b7effe5d28 --- /dev/null +++ b/arch/arm/boards/karo-tx53/config.h @@ -0,0 +1,24 @@ +/** + * @file + * @brief Global defintions for the ARM i.MX51 based babbage board + * + * 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, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/karo-tx53/env/init/bootargs-base b/arch/arm/boards/karo-tx53/env/init/bootargs-base new file mode 100644 index 0000000000..d86975406e --- /dev/null +++ b/arch/arm/boards/karo-tx53/env/init/bootargs-base @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Base bootargs" + exit +fi + +global.linux.bootargs.base="console=ttymxc0,115200" diff --git a/arch/arm/boards/karo-tx53/env/init/hostname b/arch/arm/boards/karo-tx53/env/init/hostname new file mode 100644 index 0000000000..2de91305e5 --- /dev/null +++ b/arch/arm/boards/karo-tx53/env/init/hostname @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "hostname" + exit +fi + +global.hostname=tx53 diff --git a/arch/arm/boards/karo-tx53/flash_header.c b/arch/arm/boards/karo-tx53/flash_header.c new file mode 100644 index 0000000000..9b97fab2df --- /dev/null +++ b/arch/arm/boards/karo-tx53/flash_header.c @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2011 Marc Kleine-Budde <mkl@pengutronix.de> + * + * 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. + * + */ + +#include <common.h> +#include <asm/byteorder.h> +#include <mach/imx-flash-header.h> +#include <asm/barebox-arm-head.h> + +void __naked __flash_header_start go(void) +{ + barebox_arm_head(); +} + +/* + * FIXME: These are the dcd values for a Ka-Ro TX53 1011 which + * is not in production. It has 1GB DDR2 memory. + */ +struct imx_dcd_v2_entry __dcd_entry_section dcd_entry[] = { + { .addr = cpu_to_be32(0x53fd406c), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd4070), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd4074), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd4078), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd407c), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd4080), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fd4088), .val = cpu_to_be32(0xffffffff), }, + { .addr = cpu_to_be32(0x53fa8174), .val = cpu_to_be32(0x00000011), }, + { .addr = cpu_to_be32(0x63fd800c), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8554), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8560), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8594), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8584), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8558), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa8568), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa8590), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa857c), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa8564), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa8580), .val = cpu_to_be32(0x00200040), }, + { .addr = cpu_to_be32(0x53fa8570), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8578), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa872c), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8728), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa871c), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8718), .val = cpu_to_be32(0x00200000), }, + { .addr = cpu_to_be32(0x53fa8574), .val = cpu_to_be32(0x00280000), }, + { .addr = cpu_to_be32(0x53fa8588), .val = cpu_to_be32(0x00280000), }, + { .addr = cpu_to_be32(0x53fa86f0), .val = cpu_to_be32(0x00280000), }, + { .addr = cpu_to_be32(0x53fa8720), .val = cpu_to_be32(0x00280000), }, + { .addr = cpu_to_be32(0x53fa86fc), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa86f4), .val = cpu_to_be32(0x00000200), }, + { .addr = cpu_to_be32(0x53fa8714), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8724), .val = cpu_to_be32(0x06000000), }, + { .addr = cpu_to_be32(0x63fd9088), .val = cpu_to_be32(0x36353b38), }, + { .addr = cpu_to_be32(0x63fd9090), .val = cpu_to_be32(0x49434942), }, + { .addr = cpu_to_be32(0x63fd90f8), .val = cpu_to_be32(0x00000800), }, + { .addr = cpu_to_be32(0x63fd907c), .val = cpu_to_be32(0x01350138), }, + { .addr = cpu_to_be32(0x63fd9080), .val = cpu_to_be32(0x01380139), }, + { .addr = cpu_to_be32(0x63fd9018), .val = cpu_to_be32(0x00001710), }, + { .addr = cpu_to_be32(0x63fd9000), .val = cpu_to_be32(0x84110000), }, + { .addr = cpu_to_be32(0x63fd900c), .val = cpu_to_be32(0x4d5122d2), }, + { .addr = cpu_to_be32(0x63fd9010), .val = cpu_to_be32(0xb6f18a22), }, + { .addr = cpu_to_be32(0x63fd9014), .val = cpu_to_be32(0x00c700db), }, + { .addr = cpu_to_be32(0x63fd902c), .val = cpu_to_be32(0x000026d2), }, + { .addr = cpu_to_be32(0x63fd9030), .val = cpu_to_be32(0x009f000e), }, + { .addr = cpu_to_be32(0x63fd9008), .val = cpu_to_be32(0x12272000), }, + { .addr = cpu_to_be32(0x63fd9004), .val = cpu_to_be32(0x00030012), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x04008010), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00008020), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00008020), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x0a528030), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x03868031), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00068031), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00008032), }, + { .addr = cpu_to_be32(0x63fd9020), .val = cpu_to_be32(0x00005800), }, + { .addr = cpu_to_be32(0x63fd9058), .val = cpu_to_be32(0x00033332), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00448031), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x04008018), }, + { .addr = cpu_to_be32(0x63fd901c), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x63fd9040), .val = cpu_to_be32(0x04b80003), }, + { .addr = cpu_to_be32(0x53fa8004), .val = cpu_to_be32(0x00194005), }, + { .addr = cpu_to_be32(0x53fa819c), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81a0), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81a4), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81a8), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81ac), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81b0), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81b4), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81b8), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81dc), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa81e0), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8228), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa822c), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8230), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8234), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa8238), .val = cpu_to_be32(0x00000000), }, + { .addr = cpu_to_be32(0x53fa84ec), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa84f0), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa84f4), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa84f8), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa84fc), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa8500), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa8504), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa8508), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa852c), .val = cpu_to_be32(0x00000004), }, + { .addr = cpu_to_be32(0x53fa8530), .val = cpu_to_be32(0x00000004), }, + { .addr = cpu_to_be32(0x53fa85a0), .val = cpu_to_be32(0x00000004), }, + { .addr = cpu_to_be32(0x53fa85a4), .val = cpu_to_be32(0x00000004), }, + { .addr = cpu_to_be32(0x53fa85a8), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa85ac), .val = cpu_to_be32(0x000000e4), }, + { .addr = cpu_to_be32(0x53fa85b0), .val = cpu_to_be32(0x00000004), }, +}; + +#define APP_DEST 0x70000000 + +struct imx_flash_header_v2 __flash_header_section flash_header = { + .header.tag = IVT_HEADER_TAG, + .header.length = cpu_to_be16(32), + .header.version = IVT_VERSION, + + .entry = APP_DEST + 0x1000, + .dcd_ptr = APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, dcd), + .boot_data_ptr = APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, boot_data), + .self = APP_DEST + 0x400, + + .boot_data.start = APP_DEST, + .boot_data.size = DCD_BAREBOX_SIZE, + + .dcd.header.tag = DCD_HEADER_TAG, + .dcd.header.length = cpu_to_be16(sizeof(struct imx_dcd) + sizeof(dcd_entry)), + .dcd.header.version = DCD_VERSION, + + .dcd.command.tag = DCD_COMMAND_WRITE_TAG, + .dcd.command.length = cpu_to_be16(sizeof(struct imx_dcd_command) + sizeof(dcd_entry)), + .dcd.command.param = DCD_COMMAND_WRITE_PARAM, +}; diff --git a/arch/arm/boards/mioa701/env/bin/init b/arch/arm/boards/mioa701/env/bin/init index 494d0674aa..ab5d84d68b 100644 --- a/arch/arm/boards/mioa701/env/bin/init +++ b/arch/arm/boards/mioa701/env/bin/init @@ -12,7 +12,7 @@ led keyboard 0 sdcard_override fb0.enable=1 -bmp /dev/mtd0.barebox-logo +splash /dev/mtd0.barebox-logo mtd_env_override if [ $? = 0 ]; then diff --git a/arch/arm/boards/panda/env/config b/arch/arm/boards/panda/env/config index 29a63f333b..1cd7eaa352 100644 --- a/arch/arm/boards/panda/env/config +++ b/arch/arm/boards/panda/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=panda +global.hostname=panda user= # use 'dhcp' to do dhcp in barebox and in kernel @@ -18,14 +18,14 @@ kernel_loc=tftp # can be either 'net', 'nor', 'nand' or 'initrd' rootfs_loc=net -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-${hostname}.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/pcm027/env/config b/arch/arm/boards/pcm027/env/config index 3ed963c67b..ec2752a65d 100644 --- a/arch/arm/boards/pcm027/env/config +++ b/arch/arm/boards/pcm027/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcm027 +global.hostname=pcm027 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/pcm037/env/config b/arch/arm/boards/pcm037/env/config index fcdb77764c..569bfe4b68 100644 --- a/arch/arm/boards/pcm037/env/config +++ b/arch/arm/boards/pcm037/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcm037 +global.hostname=pcm037 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/pcm043/env/config b/arch/arm/boards/pcm043/env/config index 644c7fb839..491305352e 100644 --- a/arch/arm/boards/pcm043/env/config +++ b/arch/arm/boards/pcm043/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcm043 +global.hostname=pcm043 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c index 91d8d4ba24..3159457f08 100644 --- a/arch/arm/boards/pcm049/board.c +++ b/arch/arm/boards/pcm049/board.c @@ -114,9 +114,9 @@ static int pcm049_devices_init(void) #ifdef CONFIG_PARTITION devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "xload_raw"); dev_add_bb_dev("xload_raw", "xload"); - devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw"); + devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); - devfs_add_partition("nand0", SZ_128K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); + devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif diff --git a/arch/arm/boards/pcm049/env/config b/arch/arm/boards/pcm049/env/config index efbe9ea038..0ae3e1bc3c 100644 --- a/arch/arm/boards/pcm049/env/config +++ b/arch/arm/boards/pcm049/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcm049 +global.hostname=pcm049 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-${hostname}.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-${hostname}.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" @@ -40,7 +40,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),2M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in) diff --git a/arch/arm/boards/phycard-a-l1/env/config b/arch/arm/boards/phycard-a-l1/env/config index e0f4dcc2af..6de97ed5d5 100644 --- a/arch/arm/boards/phycard-a-l1/env/config +++ b/arch/arm/boards/phycard-a-l1/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcaal1 +global.hostname=pcaal1 #user= # Enter MAC address here if not retrieved automatically @@ -26,26 +26,26 @@ rootfs_loc=nand rootfs_type=jffs2 # where is the rootfs in case of 'rootfs_loc=disk' (linux name) rootfs_part_linux_dev=mmcblk0p4 -rootfsimage=rootfs-${hostname}.$rootfs_type +rootfsimage=rootfs-${global.hostname}.$rootfs_type # where is the kernel image in case of 'kernel_loc=disk' kernel_part=disk0.2 # The image type of the kernel. Can be uimage, zimage, raw or raw_lzo -#kernelimage=zImage-$hostname -kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +#kernelimage=zImage-${global.hostname} +kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo -bareboximage=barebox-${hostname}.bin -bareboxenvimage=barebox-${hostname}.bin +bareboximage=barebox-${global.hostname}.bin +bareboxenvimage=barebox-${global.hostname}.bin if [ -n $user ]; then bareboximage="$user"-"$bareboximage" bareboxenvimage="$user"-"$bareboxenvimage" kernelimage="$user"-"$kernelimage" rootfsimage="$user"-"$rootfsimage" - nfsroot="/home/$user/nfsroot/$hostname" + nfsroot="/home/$user/nfsroot/${global.hostname}" else nfsroot="/path/to/nfs/root" fi @@ -70,7 +70,7 @@ bootargs="$bootargs omapdss.def_disp=pd050vl1" #bootargs="$bootargs omapdss.def_disp=pd104slf" #bootargs="$bootargs omapdss.def_disp=pm070wl4" -nand_parts="512k(x-loader)ro,1920k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(x-loader)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" nand_device=omap2-nand.0 rootfs_mtdblock_nand=4 diff --git a/arch/arm/boards/phycard-a-l1/pca-a-l1.c b/arch/arm/boards/phycard-a-l1/pca-a-l1.c index 5c2b436e5c..f2d10f2e6e 100644 --- a/arch/arm/boards/phycard-a-l1/pca-a-l1.c +++ b/arch/arm/boards/phycard-a-l1/pca-a-l1.c @@ -418,13 +418,13 @@ device_initcall(pcaal1_init_devices); static int pcaal1_late_init(void) { #ifdef CONFIG_PARTITION - devfs_add_partition("nand0", 0x00000, 0x80000, DEVFS_PARTITION_FIXED, "x-loader"); + devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "x-loader"); dev_add_bb_dev("self_raw", "x_loader0"); - devfs_add_partition("nand0", 0x80000, 0x1e0000, DEVFS_PARTITION_FIXED, "self_raw"); + devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); - devfs_add_partition("nand0", 0x260000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw"); + devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif return 0; diff --git a/arch/arm/boards/phycard-a-xl2/env/config b/arch/arm/boards/phycard-a-xl2/env/config index 59e8eb3851..349a51fb43 100644 --- a/arch/arm/boards/phycard-a-xl2/env/config +++ b/arch/arm/boards/phycard-a-xl2/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pcaaxl2 +global.hostname=pcaaxl2 user= # use 'dhcp' to do dhcp in barebox and in kernel @@ -20,16 +20,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-${hostname}.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-${hostname}.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" @@ -39,7 +39,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in) diff --git a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c index 0df067929b..64e6d94ae1 100644 --- a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c +++ b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c @@ -132,10 +132,10 @@ static int pcaaxl2_devices_init(void) devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "xload_raw"); dev_add_bb_dev("xload_raw", "xload"); - devfs_add_partition("nand0", SZ_128K, SZ_256K, + devfs_add_partition("nand0", SZ_128K, SZ_512K, DEVFS_PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); - devfs_add_partition("nand0", SZ_128K + SZ_256K, SZ_128K, + devfs_add_partition("nand0", SZ_128K + SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); #endif diff --git a/arch/arm/boards/phycard-i.MX27/env/config b/arch/arm/boards/phycard-i.MX27/env/config index 367029bee5..5f77440196 100644 --- a/arch/arm/boards/phycard-i.MX27/env/config +++ b/arch/arm/boards/phycard-i.MX27/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=pca100 +global.hostname=pca100 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S index c24edd49da..f98364267d 100644 --- a/arch/arm/boards/phycard-i.MX27/lowlevel_init.S +++ b/arch/arm/boards/phycard-i.MX27/lowlevel_init.S @@ -116,7 +116,10 @@ copy_loop: ldr pc, =1f /* Jump to SDRAM */ 1: - b nand_boot /* Load barebox from NAND Flash */ + ldr r0,=_text + ldr r1,=_barebox_image_size + bl imx_nand_load_image + b board_init_lowlevel_return #endif /* CONFIG_NAND_IMX_BOOT */ diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c index 16f3e4fdea..77fa8a92cd 100644 --- a/arch/arm/boards/phycard-i.MX27/pca100.c +++ b/arch/arm/boards/phycard-i.MX27/pca100.c @@ -320,11 +320,3 @@ static int pca100_console_init(void) } console_initcall(pca100_console_init); - -#ifdef CONFIG_NAND_IMX_BOOT -void __bare_init nand_boot(void) -{ - imx_nand_load_image(_text, barebox_image_size); -} -#endif - diff --git a/arch/arm/boards/qil-a9260/env/config b/arch/arm/boards/qil-a9260/env/config index c0b554625c..99711062f8 100644 --- a/arch/arm/boards/qil-a9260/env/config +++ b/arch/arm/boards/qil-a9260/env/config @@ -3,7 +3,7 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -dhcp_vendor_id=barebox-qil-a9260 +global.dhcp.vendor_id=barebox-qil-a9260 # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/scb9328/env/config b/arch/arm/boards/scb9328/env/config index a8eace7b24..ce6310b67d 100644 --- a/arch/arm/boards/scb9328/env/config +++ b/arch/arm/boards/scb9328/env/config @@ -1,6 +1,6 @@ #!/bin/sh -hostname=scb9328 +global.hostname=scb9328 eth0.serverip= user= @@ -21,16 +21,16 @@ rootfs_loc=net # can be either 'jffs2' or 'ubifs' rootfs_type=ubifs -rootfsimage=root-$hostname.$rootfs_type +rootfsimage=root-${global.hostname}.$rootfs_type -kernelimage=zImage-$hostname -#kernelimage=uImage-$hostname -#kernelimage=Image-$hostname -#kernelimage=Image-$hostname.lzo +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo if [ -n $user ]; then kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/$hostname" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" rootfsimage="$user"-"$rootfsimage" else nfsroot="$eth0.serverip:/path/to/nfs/root" diff --git a/arch/arm/boards/tny-a926x/env/config b/arch/arm/boards/tny-a926x/env/config index 514fc9f142..c19ec4fd61 100644 --- a/arch/arm/boards/tny-a926x/env/config +++ b/arch/arm/boards/tny-a926x/env/config @@ -3,9 +3,9 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -[ x$armlinux_architecture = x2058 ] && dhcp_vendor_id=barebox-tny-a9260 -[ x$armlinux_architecture = x2059 ] && dhcp_vendor_id=barebox-tny-a9g20 -[ x$armlinux_architecture = x2140 ] && dhcp_vendor_id=barebox-tny-a9263 +[ x$armlinux_architecture = x2058 ] && global.dhcp.vendor_id=barebox-tny-a9260 +[ x$armlinux_architecture = x2059 ] && global.dhcp.vendor_id=barebox-tny-a9g20 +[ x$armlinux_architecture = x2140 ] && global.dhcp.vendor_id=barebox-tny-a9263 # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/boards/usb-a926x/env/config b/arch/arm/boards/usb-a926x/env/config index dc0a264056..49199ba391 100644 --- a/arch/arm/boards/usb-a926x/env/config +++ b/arch/arm/boards/usb-a926x/env/config @@ -3,9 +3,9 @@ # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp-barebox -[ x$armlinux_architecture = x1709 ] && dhcp_vendor_id=barebox-usb-a9260 -[ x$armlinux_architecture = x1710 ] && dhcp_vendor_id=barebox-usb-a9263 -[ x$armlinux_architecture = x1841 ] && dhcp_vendor_id=barebox-usb-a9g20 +[ x$armlinux_architecture = x1709 ] && global.dhcp.vendor_id=barebox-usb-a9260 +[ x$armlinux_architecture = x1710 ] && global.dhcp.vendor_id=barebox-usb-a9263 +[ x$armlinux_architecture = x1841 ] && global.dhcp.vendor_id=barebox-usb-a9g20 # or set your networking parameters here #eth0.ipaddr=a.b.c.d diff --git a/arch/arm/configs/chumbyone_defconfig b/arch/arm/configs/chumbyone_defconfig index 33d83a87c1..1b03530c45 100644 --- a/arch/arm/configs/chumbyone_defconfig +++ b/arch/arm/configs/chumbyone_defconfig @@ -30,7 +30,7 @@ CONFIG_CMD_RESET=y CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_NET=y CONFIG_NET_DHCP=y diff --git a/arch/arm/configs/cupid_defconfig b/arch/arm/configs/cupid_defconfig index 28d199b8ed..d7716ea26b 100644 --- a/arch/arm/configs/cupid_defconfig +++ b/arch/arm/configs/cupid_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/eukrea_cpuimx25_defconfig b/arch/arm/configs/eukrea_cpuimx25_defconfig index f7207e8b89..5eb4ff37a6 100644 --- a/arch/arm/configs/eukrea_cpuimx25_defconfig +++ b/arch/arm/configs/eukrea_cpuimx25_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/eukrea_cpuimx27_defconfig b/arch/arm/configs/eukrea_cpuimx27_defconfig index 93de428e15..2b951569fc 100644 --- a/arch/arm/configs/eukrea_cpuimx27_defconfig +++ b/arch/arm/configs/eukrea_cpuimx27_defconfig @@ -31,7 +31,7 @@ CONFIG_CMD_RESET=y CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/eukrea_cpuimx35_defconfig b/arch/arm/configs/eukrea_cpuimx35_defconfig index 880beb6f19..16ef4ccef3 100644 --- a/arch/arm/configs/eukrea_cpuimx35_defconfig +++ b/arch/arm/configs/eukrea_cpuimx35_defconfig @@ -44,7 +44,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/freescale_mx35_3stack_defconfig b/arch/arm/configs/freescale_mx35_3stack_defconfig index a60658dc2f..4052325e95 100644 --- a/arch/arm/configs/freescale_mx35_3stack_defconfig +++ b/arch/arm/configs/freescale_mx35_3stack_defconfig @@ -42,7 +42,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/freescale_mx51_babbage_defconfig b/arch/arm/configs/freescale_mx51_babbage_defconfig index 22ef163a4b..0817cfa957 100644 --- a/arch/arm/configs/freescale_mx51_babbage_defconfig +++ b/arch/arm/configs/freescale_mx51_babbage_defconfig @@ -17,6 +17,7 @@ CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y CONFIG_DEFAULT_ENVIRONMENT_COMPRESSED_LZO=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/freescale-mx51-pdk/env/" CONFIG_CMD_EDIT=y CONFIG_CMD_SLEEP=y @@ -39,7 +40,6 @@ CONFIG_CMD_BOOTM_INITRD=y CONFIG_CMD_BOOTM_OFTREE=y CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y CONFIG_CMD_UIMAGE=y -# CONFIG_CMD_BOOTZ is not set # CONFIG_CMD_BOOTU is not set CONFIG_CMD_RESET=y CONFIG_CMD_GO=y diff --git a/arch/arm/configs/imx233-olinuxino_defconfig b/arch/arm/configs/imx233-olinuxino_defconfig new file mode 100644 index 0000000000..40b7e1df2e --- /dev/null +++ b/arch/arm/configs/imx233-olinuxino_defconfig @@ -0,0 +1,63 @@ +CONFIG_ARCH_MXS=y +CONFIG_MACH_IMX233_OLINUXINO=y +CONFIG_AEABI=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_BROKEN=y +CONFIG_EXPERIMENTAL=y +CONFIG_MODULES=y +CONFIG_LONGHELP=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/imx233-olinuxino/env" +CONFIG_BAREBOXENV_TARGET=y +CONFIG_DEBUG_INFO=y +CONFIG_ENABLE_FLASH_NOISE=y +CONFIG_ENABLE_PARTITION_NOISE=y +CONFIG_ENABLE_DEVICE_NOISE=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_BOOTM_VERBOSE=y +CONFIG_CMD_BOOTM_INITRD=y +CONFIG_CMD_BOOTM_OFTREE=y +CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y +CONFIG_CMD_UIMAGE=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_RESET=y +CONFIG_CMD_OFTREE=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_NET=y +CONFIG_NET_DHCP=y +CONFIG_NET_NFS=y +CONFIG_NET_PING=y +CONFIG_NET_TFTP=y +CONFIG_NET_TFTP_PUSH=y +CONFIG_NET_NETCONSOLE=y +CONFIG_NET_RESOLV=y +CONFIG_NET_USB=y +CONFIG_NET_USB_SMSC95XX=y +CONFIG_DISK_INTF_PLATFORM_IDE=y +CONFIG_USB=y +CONFIG_USB_EHCI=y +CONFIG_USB_STORAGE=y +CONFIG_VIDEO=y +CONFIG_DRIVER_VIDEO_STM=y +CONFIG_MCI=y +CONFIG_MCI_STARTUP=y +CONFIG_MCI_MXS=y +CONFIG_LED=y +CONFIG_KEYBOARD_GPIO=y +CONFIG_MXS_APBH_DMA=y +CONFIG_FS_TFTP=y +CONFIG_FS_NFS=y +CONFIG_FS_FAT=y diff --git a/arch/arm/configs/imx28evk_defconfig b/arch/arm/configs/imx28evk_defconfig index 1b44cf4ecc..f4d4661918 100644 --- a/arch/arm/configs/imx28evk_defconfig +++ b/arch/arm/configs/imx28evk_defconfig @@ -33,7 +33,7 @@ CONFIG_CMD_RESET=y CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_NET=y CONFIG_NET_DHCP=y diff --git a/arch/arm/configs/mioa701_defconfig b/arch/arm/configs/mioa701_defconfig index 2bb3ceccbf..5f06b3c771 100644 --- a/arch/arm/configs/mioa701_defconfig +++ b/arch/arm/configs/mioa701_defconfig @@ -38,7 +38,7 @@ CONFIG_CMD_BOOTM_INITRD=y CONFIG_CMD_RESET=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_LED=y diff --git a/arch/arm/configs/neso_defconfig b/arch/arm/configs/neso_defconfig index 5744dc1c71..3ea689195a 100644 --- a/arch/arm/configs/neso_defconfig +++ b/arch/arm/configs/neso_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/pcm027_defconfig b/arch/arm/configs/pcm027_defconfig index 9760e66065..5a65a720ba 100644 --- a/arch/arm/configs/pcm027_defconfig +++ b/arch/arm/configs/pcm027_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/pcm038_defconfig b/arch/arm/configs/pcm038_defconfig index 5ce4f7abcc..bab4002a6a 100644 --- a/arch/arm/configs/pcm038_defconfig +++ b/arch/arm/configs/pcm038_defconfig @@ -49,7 +49,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/phycard_a_l1_defconfig b/arch/arm/configs/phycard_a_l1_defconfig index cf980f7ffb..4cf2d210c9 100644 --- a/arch/arm/configs/phycard_a_l1_defconfig +++ b/arch/arm/configs/phycard_a_l1_defconfig @@ -134,7 +134,7 @@ CONFIG_NET_NETCONSOLE=y CONFIG_NET_RESOLV=y CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y -CONFIG_MIIDEV=y +CONFIG_PHYLIB=y CONFIG_DRIVER_NET_SMC911X=y CONFIG_DRIVER_NET_SMC911X_ADDRESS_SHIFT=0 CONFIG_SPI=n diff --git a/arch/arm/configs/tx25stk5_defconfig b/arch/arm/configs/tx25stk5_defconfig index 99057c2862..e098ef885b 100644 --- a/arch/arm/configs/tx25stk5_defconfig +++ b/arch/arm/configs/tx25stk5_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/tx28stk5_defconfig b/arch/arm/configs/tx28stk5_defconfig index b4e3747801..49a0ab3c40 100644 --- a/arch/arm/configs/tx28stk5_defconfig +++ b/arch/arm/configs/tx28stk5_defconfig @@ -41,7 +41,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/tx51stk5_defconfig b/arch/arm/configs/tx51stk5_defconfig index 7fff0f0d10..2c831890c7 100644 --- a/arch/arm/configs/tx51stk5_defconfig +++ b/arch/arm/configs/tx51stk5_defconfig @@ -110,7 +110,7 @@ CONFIG_NET_TFTP=y CONFIG_NET_TFTP_PUSH=y CONFIG_DRIVER_SERIAL_IMX=y CONFIG_ARCH_HAS_FEC_IMX=y -CONFIG_MIIDEV=y +CONFIG_PHYLIB=y CONFIG_DRIVER_NET_FEC_IMX=y CONFIG_DRIVER_SPI_IMX_2_3=y CONFIG_MTD=y diff --git a/arch/arm/configs/tx53stk5_defconfig b/arch/arm/configs/tx53stk5_defconfig new file mode 100644 index 0000000000..95cf460b47 --- /dev/null +++ b/arch/arm/configs/tx53stk5_defconfig @@ -0,0 +1,76 @@ +CONFIG_ARCH_IMX=y +CONFIG_ARCH_IMX53=y +CONFIG_MACH_TX53=y +CONFIG_IMX_IIM=y +CONFIG_AEABI=y +CONFIG_THUMB2_BAREBOX=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_ARM_UNWIND=y +CONFIG_MMU=y +CONFIG_TEXT_BASE=0x97f00000 +CONFIG_MALLOC_SIZE=0x2000000 +CONFIG_MALLOC_TLSF=y +CONFIG_KALLSYMS=y +CONFIG_LONGHELP=y +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_DEFAULT_ENVIRONMENT_COMPRESSED_LZO=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/karo-tx53/env" +CONFIG_RESET_SOURCE=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_MSLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_TIME=y +CONFIG_CMD_DIRNAME=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_BOOTM_VERBOSE=y +CONFIG_CMD_BOOTM_INITRD=y +CONFIG_CMD_BOOTM_OFTREE=y +CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y +CONFIG_CMD_UIMAGE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_LED=y +CONFIG_NET=y +CONFIG_NET_DHCP=y +CONFIG_NET_PING=y +CONFIG_NET_TFTP=y +CONFIG_NET_TFTP_PUSH=y +CONFIG_DRIVER_NET_FEC_IMX=y +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_IMX=y +CONFIG_UBI=y +CONFIG_MCI=y +CONFIG_MCI_STARTUP=y +CONFIG_MCI_IMX_ESDHC=y +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_FS_TFTP=y +CONFIG_FS_NFS=y +CONFIG_FS_FAT=y +CONFIG_ZLIB=y +CONFIG_LZO_DECOMPRESS=y diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index dad8092e9f..e3ca722300 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -144,7 +144,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank) if ((phys & (SZ_1M - 1)) || (bank->size & (SZ_1M - 1))) return -EINVAL; - ptes = memalign(PAGE_SIZE, num_ptes * sizeof(u32)); + ptes = xmemalign(PAGE_SIZE, num_ptes * sizeof(u32)); debug("ptes: 0x%p ttb_start: 0x%08lx ttb_end: 0x%08lx\n", ptes, ttb_start, ttb_end); diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c index 932a3da9e2..04b54304e1 100644 --- a/arch/arm/cpu/start-pbl.c +++ b/arch/arm/cpu/start-pbl.c @@ -36,6 +36,9 @@ unsigned long free_mem_ptr; unsigned long free_mem_end_ptr; +/* + * First instructions in the pbl image + */ void __naked __section(.text_head_entry) pbl_start(void) { barebox_arm_head(); @@ -116,7 +119,11 @@ static void mmu_disable(void) static void barebox_uncompress(void *compressed_start, unsigned int len) { void (*barebox)(void); - int use_mmu = IS_ENABLED(CONFIG_MMU); + /* + * remap_cached currently does not work rendering the feature + * of enabling the MMU in the PBL useless. disable for now. + */ + int use_mmu = 0; /* set 128 KiB at the end of the MALLOC_BASE for early malloc */ free_mem_ptr = MALLOC_BASE + MALLOC_SIZE - SZ_128K; @@ -149,23 +156,17 @@ static void barebox_uncompress(void *compressed_start, unsigned int len) * Board code can jump here by either returning from board_init_lowlevel * or by calling this function directly. */ -void __naked __section(.text_ll_return) board_init_lowlevel_return(void) +void __naked board_init_lowlevel_return(void) { - uint32_t r, addr, offset; + uint32_t r, offset; uint32_t pg_start, pg_end, pg_len; - /* - * Get runtime address of this function. Do not - * put any code above this. - */ - __asm__ __volatile__("1: adr %0, 1b":"=r"(addr)); - /* Setup the stack */ r = STACK_BASE + STACK_SIZE - 16; __asm__ __volatile__("mov sp, %0" : : "r"(r)); /* Get offset between linked address and runtime address */ - offset = (uint32_t)__ll_return - addr; + offset = get_runtime_offset(); pg_start = (uint32_t)&input_data - offset; pg_end = (uint32_t)&input_data_end - offset; diff --git a/arch/arm/cpu/start-reset.c b/arch/arm/cpu/start-reset.c index e0df676274..fcfdce6bff 100644 --- a/arch/arm/cpu/start-reset.c +++ b/arch/arm/cpu/start-reset.c @@ -29,6 +29,9 @@ /* * The actual reset vector. This code is position independent and usually * does not run at the address it's linked at. + * + * This is either executed in the pbl image (if enabled) or in the regular + * image. */ void __naked __bare_init reset(void) { diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index 9775b7f17f..97098f3b36 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -27,7 +27,7 @@ #ifdef CONFIG_PBL_IMAGE /* - * First function in the pbl image. We get here from + * First function in the uncompressed image. We get here from * the pbl. */ void __naked __section(.text_entry) start(void) @@ -44,6 +44,9 @@ void __naked __section(.text_entry) start(void) } #else +/* + * First function in the image without pbl support + */ void __naked __section(.text_entry) start(void) { barebox_arm_head(); @@ -53,22 +56,16 @@ void __naked __section(.text_entry) start(void) * Board code can jump here by either returning from board_init_lowlevel * or by calling this function directly. */ -void __naked __section(.text_ll_return) board_init_lowlevel_return(void) +void __naked board_init_lowlevel_return(void) { - uint32_t r, addr, offset; - - /* - * Get runtime address of this function. Do not - * put any code above this. - */ - __asm__ __volatile__("1: adr %0, 1b":"=r"(addr)); + uint32_t r, offset; /* Setup the stack */ r = STACK_BASE + STACK_SIZE - 16; __asm__ __volatile__("mov sp, %0" : : "r"(r)); /* Get offset between linked address and runtime address */ - offset = (uint32_t)__ll_return - addr; + offset = get_runtime_offset(); /* relocate to link address if necessary */ if (offset) diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h index 0fe6c47bae..8862f367c2 100644 --- a/arch/arm/include/asm/barebox-arm.h +++ b/arch/arm/include/asm/barebox-arm.h @@ -33,10 +33,10 @@ int board_init(void); int dram_init (void); extern char __exceptions_start[], __exceptions_stop[]; -extern char __ll_return[]; void board_init_lowlevel(void); void board_init_lowlevel_return(void); void arch_init_lowlevel(void); +uint32_t get_runtime_offset(void); #endif /* _BAREBOX_ARM_H_ */ diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 9d0ff7a856..2e624cdf84 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -16,6 +16,8 @@ obj-y += lib1funcs.o obj-y += ashrdi3.o obj-y += ashldi3.o obj-y += lshrdi3.o +obj-y += runtime-offset.o +pbl-y += runtime-offset.o obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o obj-$(CONFIG_ARM_UNWIND) += unwind.o diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index 182930f0a7..9c134ed4b8 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -75,7 +75,7 @@ void armlinux_set_revision(unsigned int rev) #ifdef CONFIG_ENVIRONMENT_VARIABLES export_env_ull("armlinux_system_rev", rev); #else - return armlinux_system_rev; + armlinux_system_rev = rev; #endif } diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S index 465cb55d24..bac1a04f87 100644 --- a/arch/arm/lib/barebox.lds.S +++ b/arch/arm/lib/barebox.lds.S @@ -36,8 +36,6 @@ SECTIONS _stext = .; _text = .; *(.text_entry*) - __ll_return = .; - *(.text_ll_return*) __bare_init_start = .; *(.text_bare_init*) __bare_init_end = .; diff --git a/arch/arm/lib/runtime-offset.S b/arch/arm/lib/runtime-offset.S new file mode 100644 index 0000000000..ffa668cd7e --- /dev/null +++ b/arch/arm/lib/runtime-offset.S @@ -0,0 +1,17 @@ +#include <linux/linkage.h> +#include <asm/assembler.h> + +/* + * Get the offset between the link address and the address + * we are currently running at. + */ +ENTRY(get_runtime_offset) +1: adr r0, 1b + ldr r1, linkadr + subs r0, r1, r0 +THUMB( subs r0, r0, #1) + mov pc, lr + +linkadr: +.word get_runtime_offset +ENDPROC(get_runtime_offset) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index ce5edaa336..7ab812abc5 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -27,6 +27,7 @@ config ARCH_TEXT_BASE default 0x4fc00000 if MACH_MX6Q_ARM2 default 0x97f00000 if MACH_CCMX51 default 0x4fc00000 if MACH_SABRELITE + default 0x7fe00000 if MACH_TX53 config BOARDINFO default "Eukrea CPUIMX25" if MACH_EUKREA_CPUIMX25 @@ -53,6 +54,7 @@ config BOARDINFO default "Freescale i.MX6q armadillo2" if MACH_MX6Q_ARM2 default "ConnectCore i.MX51" if MACH_CCMX51 default "Sabre Lite" if MACH_SABRELITE + default "Ka-Ro tx53" if MACH_TX53 choice prompt "Select boot mode" @@ -459,6 +461,12 @@ config MACH_TQMA53_1GB_RAM help use 1GiB of SDRAM (512MiB otherwise) +config MACH_TX53 + bool "Ka-Ro TX53" + select HAVE_DEFAULT_ENVIRONMENT_NEW + help + Say Y here if you are using the Ka-Ro tx53 board + endchoice endif diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c index fccc2f70ff..2c6f6a08e6 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -28,17 +28,45 @@ #include <common.h> #include <init.h> #include <clock.h> +#include <errno.h> #include <notifier.h> #include <mach/imx-regs.h> #include <mach/clock.h> #include <io.h> -#define GPT(x) __REG(IMX_TIM1_BASE + (x)) -#define timer_base IOMEM(IMX_TIM1_BASE) +/* Part 1: Registers */ +# define GPT_TCTL 0x00 +# define GPT_TPRER 0x04 + +/* Part 2: Bitfields */ +#define TCTL_SWR (1 << 15) /* Software reset */ +#define IMX1_TCTL_FRR (1 << 8) /* Freerun / restart */ +#define IMX31_TCTL_FRR (1 << 9) /* Freerun / restart */ +#define IMX1_TCTL_CLKSOURCE_IPG (1 << 1) /* Clock source bit position */ +#define IMX31_TCTL_CLKSOURCE_IPG (1 << 6) /* Clock source bit position */ +#define TCTL_TEN (1 << 0) /* Timer enable */ + +struct imx_gpt_regs { + unsigned int tcn; + uint32_t tctl_val; +}; + +static struct imx_gpt_regs regs_imx1 = { + .tcn = 0x10, + .tctl_val = IMX1_TCTL_FRR | IMX1_TCTL_CLKSOURCE_IPG | TCTL_TEN, +}; + +static struct imx_gpt_regs regs_imx31 = { + .tcn = 0x24, + .tctl_val = IMX31_TCTL_FRR | IMX31_TCTL_CLKSOURCE_IPG | TCTL_TEN, +}; + +static struct imx_gpt_regs *regs; +static void __iomem *timer_base; static uint64_t imx_clocksource_read(void) { - return readl(timer_base + GPT_TCN); + return readl(timer_base + regs->tcn); } static struct clocksource cs = { @@ -57,10 +85,20 @@ static struct notifier_block imx_clock_notifier = { .notifier_call = imx_clocksource_clock_change, }; -static int clocksource_init (void) +static int imx_gpt_probe(struct device_d *dev) { int i; - uint32_t val; + int ret; + + /* one timer is enough */ + if (timer_base) + return -EBUSY; + + ret = dev_get_drvdata(dev, (unsigned long *)®s); + if (ret) + return ret; + + timer_base = dev_request_mem_region(dev, 0); /* setup GP Timer 1 */ writel(TCTL_SWR, timer_base + GPT_TCTL); @@ -81,9 +119,7 @@ static int clocksource_init (void) writel(0, timer_base + GPT_TCTL); /* We have no udelay by now */ writel(0, timer_base + GPT_TPRER); - val = readl(timer_base + GPT_TCTL); - val |= TCTL_FRR | (1 << TCTL_CLKSOURCE) | TCTL_TEN; /* Freerun Mode, PERCLK1 input */ - writel(val, timer_base + GPT_TCTL); + writel(regs->tctl_val, timer_base + GPT_TCTL); cs.mult = clocksource_hz2mult(imx_get_gptclk(), cs.shift); @@ -94,7 +130,42 @@ static int clocksource_init (void) return 0; } -core_initcall(clocksource_init); +static __maybe_unused struct of_device_id imx_gpt_dt_ids[] = { + { + .compatible = "fsl,imx1-gpt", + .data = (unsigned long)®s_imx1, + }, { + .compatible = "fsl,imx31-gpt", + .data = (unsigned long)®s_imx31, + }, { + /* sentinel */ + } +}; + +static struct platform_device_id imx_gpt_ids[] = { + { + .name = "imx1-gpt", + .driver_data = (unsigned long)®s_imx1, + }, { + .name = "imx31-gpt", + .driver_data = (unsigned long)®s_imx31, + }, { + /* sentinel */ + }, +}; + +static struct driver_d imx_gpt_driver = { + .name = "imx-gpt", + .probe = imx_gpt_probe, + .of_compatible = DRV_OF_COMPAT(imx_gpt_dt_ids), + .id_table = imx_gpt_ids, +}; + +static int imx_gpt_init(void) +{ + return register_driver(&imx_gpt_driver); +} +coredevice_initcall(imx_gpt_init); /* * Watchdog Registers diff --git a/arch/arm/mach-imx/gpio.c b/arch/arm/mach-imx/gpio.c index 324794ae68..268e598195 100644 --- a/arch/arm/mach-imx/gpio.c +++ b/arch/arm/mach-imx/gpio.c @@ -27,28 +27,28 @@ #include <gpio.h> #include <init.h> -#if defined CONFIG_ARCH_IMX1 || defined CONFIG_ARCH_IMX21 || defined CONFIG_ARCH_IMX27 -#define GPIO_DR 0x1c -#define GPIO_GDIR 0x00 -#define GPIO_PSR 0x24 -#define GPIO_ICR1 0x28 -#define GPIO_ICR2 0x2C -#define GPIO_IMR 0x30 -#define GPIO_ISR 0x34 -#else -#define GPIO_DR 0x00 -#define GPIO_GDIR 0x04 -#define GPIO_PSR 0x08 -#define GPIO_ICR1 0x0C -#define GPIO_ICR2 0x10 -#define GPIO_IMR 0x14 -#define GPIO_ISR 0x18 -#define GPIO_ISR 0x18 -#endif - struct imx_gpio_chip { void __iomem *base; struct gpio_chip chip; + struct imx_gpio_regs *regs; +}; + +struct imx_gpio_regs { + unsigned int dr; + unsigned int gdir; + unsigned int psr; +}; + +static struct imx_gpio_regs regs_imx1 = { + .dr = 0x1c, + .gdir = 0x00, + .psr = 0x24, +}; + +static struct imx_gpio_regs regs_imx31 = { + .dr = 0x00, + .gdir = 0x04, + .psr = 0x08, }; static void imx_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value) @@ -60,14 +60,14 @@ static void imx_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value) if (!base) return; - val = readl(base + GPIO_DR); + val = readl(base + imxgpio->regs->dr); if (value) val |= 1 << gpio; else val &= ~(1 << gpio); - writel(val, base + GPIO_DR); + writel(val, base + imxgpio->regs->dr); } static int imx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) @@ -79,9 +79,9 @@ static int imx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) if (!base) return -EINVAL; - val = readl(base + GPIO_GDIR); + val = readl(base + imxgpio->regs->gdir); val &= ~(1 << gpio); - writel(val, base + GPIO_GDIR); + writel(val, base + imxgpio->regs->gdir); return 0; } @@ -95,9 +95,9 @@ static int imx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int gpio_set_value(gpio + chip->base, value); - val = readl(base + GPIO_GDIR); + val = readl(base + imxgpio->regs->gdir); val |= 1 << gpio; - writel(val, base + GPIO_GDIR); + writel(val, base + imxgpio->regs->gdir); return 0; } @@ -108,7 +108,7 @@ static int imx_gpio_get_value(struct gpio_chip *chip, unsigned gpio) void __iomem *base = imxgpio->base; u32 val; - val = readl(base + GPIO_PSR); + val = readl(base + imxgpio->regs->psr); return val & (1 << gpio) ? 1 : 0; } @@ -123,23 +123,80 @@ static struct gpio_ops imx_gpio_ops = { static int imx_gpio_probe(struct device_d *dev) { struct imx_gpio_chip *imxgpio; + struct imx_gpio_regs *regs; + int ret; + + ret = dev_get_drvdata(dev, (unsigned long *)®s); + if (ret) + return ret; imxgpio = xzalloc(sizeof(*imxgpio)); imxgpio->base = dev_request_mem_region(dev, 0); imxgpio->chip.ops = &imx_gpio_ops; - imxgpio->chip.base = -1; + if (dev->id < 0) { + imxgpio->chip.base = of_alias_get_id(dev->device_node, "gpio"); + if (imxgpio->chip.base < 0) + return imxgpio->chip.base; + } else { + imxgpio->chip.base = dev->id * 32; + } imxgpio->chip.ngpio = 32; imxgpio->chip.dev = dev; + imxgpio->regs = regs; gpiochip_add(&imxgpio->chip); - dev_info(dev, "probed gpiochip%d with base %d\n", dev->id, imxgpio->chip.base); + dev_dbg(dev, "probed gpiochip%d with base %d\n", dev->id, imxgpio->chip.base); return 0; } +static __maybe_unused struct of_device_id imx_gpio_dt_ids[] = { + { + .compatible = "fsl,imx1-gpio", + .data = (unsigned long)®s_imx1, + }, { + .compatible = "fsl,imx21-gpio", + .data = (unsigned long)®s_imx1, + }, { + .compatible = "fsl,imx27-gpio", + .data = (unsigned long)®s_imx1, + }, { + .compatible = "fsl,imx31-gpio", + .data = (unsigned long)®s_imx31, + }, { + .compatible = "fsl,imx35-gpio", + .data = (unsigned long)®s_imx31, + }, { + .compatible = "fsl,imx51-gpio", + .data = (unsigned long)®s_imx31, + }, { + .compatible = "fsl,imx53-gpio", + .data = (unsigned long)®s_imx31, + }, { + .compatible = "fsl,imx6q-gpio", + .data = (unsigned long)®s_imx31, + }, { + /* sentinel */ + } +}; + +static struct platform_device_id imx_gpio_ids[] = { + { + .name = "imx1-gpio", + .driver_data = (unsigned long)®s_imx1, + }, { + .name = "imx31-gpio", + .driver_data = (unsigned long)®s_imx31, + }, { + /* sentinel */ + }, +}; + static struct driver_d imx_gpio_driver = { .name = "imx-gpio", .probe = imx_gpio_probe, + .of_compatible = DRV_OF_COMPAT(imx_gpio_dt_ids), + .id_table = imx_gpio_ids, }; static int imx_gpio_add(void) diff --git a/arch/arm/mach-imx/imx1.c b/arch/arm/mach-imx/imx1.c index 45d5a11485..b32e371275 100644 --- a/arch/arm/mach-imx/imx1.c +++ b/arch/arm/mach-imx/imx1.c @@ -16,10 +16,11 @@ static int imx1_init(void) { - add_generic_device("imx-gpio", 0, NULL, 0x0021c000, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x0021c100, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x0021c200, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, 0x0021c300, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpt", 0, NULL, 0x00202000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 0, NULL, 0x0021c000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 1, NULL, 0x0021c100, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 2, NULL, 0x0021c200, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 3, NULL, 0x0021c300, 0x100, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/imx21.c b/arch/arm/mach-imx/imx21.c index 78e8d772ef..df3eaf2666 100644 --- a/arch/arm/mach-imx/imx21.c +++ b/arch/arm/mach-imx/imx21.c @@ -25,12 +25,13 @@ int imx_silicon_revision(void) static int imx21_init(void) { - add_generic_device("imx-gpio", 0, NULL, 0x10015000, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x10015100, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x10015200, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, 0x10015300, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 4, NULL, 0x10015400, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 5, NULL, 0x10015500, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpt", 0, NULL, 0x10003000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 0, NULL, 0x10015000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 1, NULL, 0x10015100, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 2, NULL, 0x10015200, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 3, NULL, 0x10015300, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 4, NULL, 0x10015400, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 5, NULL, 0x10015500, 0x100, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c index a9f58c4db6..dd10d58767 100644 --- a/arch/arm/mach-imx/imx25.c +++ b/arch/arm/mach-imx/imx25.c @@ -44,10 +44,12 @@ static int imx25_init(void) add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K, IORESOURCE_MEM, &imx25_iim_pdata); - add_generic_device("imx-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, 0x53f9c000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0x53f90000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 3, NULL, 0x53f9c000, 0x1000, IORESOURCE_MEM, NULL); + return 0; } coredevice_initcall(imx25_init); diff --git a/arch/arm/mach-imx/imx27.c b/arch/arm/mach-imx/imx27.c index 2fc0af5f5f..32a32a33a6 100644 --- a/arch/arm/mach-imx/imx27.c +++ b/arch/arm/mach-imx/imx27.c @@ -69,12 +69,13 @@ static int imx27_init(void) imx27_init_max(); - add_generic_device("imx-gpio", 0, NULL, 0x10015000, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x10015100, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x10015200, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, 0x10015300, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 4, NULL, 0x10015400, 0x100, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 5, NULL, 0x10015500, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpt", 0, NULL, 0x10003000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 0, NULL, 0x10015000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 1, NULL, 0x10015100, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 2, NULL, 0x10015200, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 3, NULL, 0x10015300, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 4, NULL, 0x10015400, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx1-gpio", 5, NULL, 0x10015500, 0x100, IORESOURCE_MEM, NULL); return 0; } -coredevice_initcall(imx27_init); +console_initcall(imx27_init); diff --git a/arch/arm/mach-imx/imx31.c b/arch/arm/mach-imx/imx31.c index 433ffb73b0..881c3e586e 100644 --- a/arch/arm/mach-imx/imx31.c +++ b/arch/arm/mach-imx/imx31.c @@ -21,9 +21,10 @@ static int imx31_init(void) add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0x53f90000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c index ffe6979b36..579e14814d 100644 --- a/arch/arm/mach-imx/imx35.c +++ b/arch/arm/mach-imx/imx35.c @@ -52,9 +52,10 @@ static int imx35_init(void) add_generic_device("imx_iim", 0, NULL, IMX_IIM_BASE, SZ_4K, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0x53f90000, 0x100, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, 0x53fcc000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, 0x53fd0000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, 0x53fa4000, 0x1000, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/imx51.c b/arch/arm/mach-imx/imx51.c index a45bd599cb..022614ffde 100644 --- a/arch/arm/mach-imx/imx51.c +++ b/arch/arm/mach-imx/imx51.c @@ -74,10 +74,11 @@ static int imx51_init(void) add_generic_device("imx_iim", 0, NULL, MX51_IIM_BASE_ADDR, SZ_4K, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 0, NULL, 0x73f84000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, 0x73f88000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, 0x73f8c000, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, 0x73f90000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0x73fa0000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, 0x73f84000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, 0x73f88000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, 0x73f8c000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 3, NULL, 0x73f90000, 0x1000, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/imx53.c b/arch/arm/mach-imx/imx53.c index 5bfc864ced..2d7c174e25 100644 --- a/arch/arm/mach-imx/imx53.c +++ b/arch/arm/mach-imx/imx53.c @@ -70,13 +70,15 @@ static int imx53_init(void) add_generic_device("imx_iim", 0, NULL, MX53_IIM_BASE_ADDR, SZ_4K, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 0, NULL, MX53_GPIO1_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, MX53_GPIO2_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, MX53_GPIO3_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, MX53_GPIO4_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 4, NULL, MX53_GPIO5_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 5, NULL, MX53_GPIO6_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 6, NULL, MX53_GPIO7_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0X53fa0000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, MX53_GPIO1_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, MX53_GPIO2_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, MX53_GPIO3_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 3, NULL, MX53_GPIO4_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 4, NULL, MX53_GPIO5_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 5, NULL, MX53_GPIO6_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 6, NULL, MX53_GPIO7_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL); + return 0; } coredevice_initcall(imx53_init); diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c index 79b6502572..babf8fea80 100644 --- a/arch/arm/mach-imx/imx6.c +++ b/arch/arm/mach-imx/imx6.c @@ -54,13 +54,14 @@ void imx6_init_lowlevel(void) static int imx6_init(void) { - add_generic_device("imx-gpio", 0, NULL, MX6_GPIO1_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 1, NULL, MX6_GPIO2_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 2, NULL, MX6_GPIO3_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 3, NULL, MX6_GPIO4_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 4, NULL, MX6_GPIO5_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 5, NULL, MX6_GPIO6_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); - add_generic_device("imx-gpio", 6, NULL, MX6_GPIO7_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpt", 0, NULL, 0x02098000, 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 0, NULL, MX6_GPIO1_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 1, NULL, MX6_GPIO2_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 2, NULL, MX6_GPIO3_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 3, NULL, MX6_GPIO4_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 4, NULL, MX6_GPIO5_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 5, NULL, MX6_GPIO6_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); + add_generic_device("imx31-gpio", 6, NULL, MX6_GPIO7_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL); return 0; } diff --git a/arch/arm/mach-imx/include/mach/imx1-regs.h b/arch/arm/mach-imx/include/mach/imx1-regs.h index f940cdb4b2..d5ee3f58a6 100644 --- a/arch/arm/mach-imx/include/mach/imx1-regs.h +++ b/arch/arm/mach-imx/include/mach/imx1-regs.h @@ -207,27 +207,4 @@ #define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 ) #define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 ) -/* - * Definitions for the clocksource driver - */ -/* Part 1: Registers */ -# define GPT_TCTL 0x00 -# define GPT_TPRER 0x04 -# define GPT_TCMP 0x08 -# define GPT_TCR 0x0c -# define GPT_TCN 0x10 -# define GPT_TSTAT 0x14 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<8) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (1) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #endif /* _IMX1_REGS_H */ diff --git a/arch/arm/mach-imx/include/mach/imx21-regs.h b/arch/arm/mach-imx/include/mach/imx21-regs.h index a2c4d03643..98e73ef27e 100644 --- a/arch/arm/mach-imx/include/mach/imx21-regs.h +++ b/arch/arm/mach-imx/include/mach/imx21-regs.h @@ -107,30 +107,6 @@ #define CCSR_32K_SR (1 << 15) -/* - * Definitions for the clocksource driver - */ -/* Part 1: Registers */ -# define GPT_TCTL 0x00 -# define GPT_TPRER 0x04 -# define GPT_TCMP 0x08 -# define GPT_TCR 0x0c -# define GPT_TCN 0x10 -# define GPT_TSTAT 0x14 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_CC (1<<10) /* counter clear */ -#define TCTL_FRR (1<<8) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_CAPEN (1<<5) /* compare interrupt enable */ -#define TCTL_COMPEN (1<<4) /* compare interrupt enable */ -#define TCTL_CLKSOURCE (1) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #define IMX_CS0_BASE 0xC8000000 #define IMX_CS1_BASE 0xCC000000 #define IMX_CS2_BASE 0xD0000000 diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h index 174cc9ac12..5176b5e813 100644 --- a/arch/arm/mach-imx/include/mach/imx25-regs.h +++ b/arch/arm/mach-imx/include/mach/imx25-regs.h @@ -104,33 +104,6 @@ #define CSCR_A(x) (WEIM_BASE + 8 + (x) * 0x10) /* - * Definitions for the clocksource driver - * - * These defines are using the i.MX1/27 notation - * to reuse the clocksource code for these CPUs - * on the i.MX35 - */ -/* Part 1: Registers */ -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - -/* * Watchdog Registers */ #define WCR __REG16(IMX_WDT_BASE + 0x00) /* Watchdog Control Register */ diff --git a/arch/arm/mach-imx/include/mach/imx27-regs.h b/arch/arm/mach-imx/include/mach/imx27-regs.h index 19dcad9e9b..8686a9dfc3 100644 --- a/arch/arm/mach-imx/include/mach/imx27-regs.h +++ b/arch/arm/mach-imx/include/mach/imx27-regs.h @@ -221,29 +221,6 @@ #define ESDCFG_TWTR (1 << 20) #define ESDCFG_TXP(x) (((x) & 0x3) << 21) -/* - * Definitions for the clocksource driver - */ -/* Part 1: Registers */ -# define GPT_TCTL 0x00 -# define GPT_TPRER 0x04 -# define GPT_TCMP 0x08 -# define GPT_TCR 0x0c -# define GPT_TCN 0x10 -# define GPT_TSTAT 0x14 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<8) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (1) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #define IMX_CS0_BASE 0xC0000000 #define IMX_CS1_BASE 0xC8000000 #define IMX_CS2_BASE 0xD0000000 diff --git a/arch/arm/mach-imx/include/mach/imx31-regs.h b/arch/arm/mach-imx/include/mach/imx31-regs.h index 280b42cb94..e3473d4dea 100644 --- a/arch/arm/mach-imx/include/mach/imx31-regs.h +++ b/arch/arm/mach-imx/include/mach/imx31-regs.h @@ -53,33 +53,6 @@ #define IMX_CS5_BASE 0xB6000000 #define IMX_CS5_RANGE (32 * 1024 * 1024) -/* - * Definitions for the clocksource driver - * - * These defines are using the i.MX1/27 notation - * to reuse the clocksource code for these CPUs - * on the i.MX31 - */ -/* Part 1: Registers */ -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #if 0 #define IMX_IO_BASE 0x00200000 diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h index 6f3fd26440..5a4ab90082 100644 --- a/arch/arm/mach-imx/include/mach/imx35-regs.h +++ b/arch/arm/mach-imx/include/mach/imx35-regs.h @@ -112,32 +112,4 @@ #define CSCR_L(x) (WEIM_BASE + 4 + (x) * 0x10) #define CSCR_A(x) (WEIM_BASE + 8 + (x) * 0x10) -/* - * Definitions for the clocksource driver - * - * These defines are using the i.MX1/27 notation - * to reuse the clocksource code for these CPUs - * on the i.MX35 - */ -/* Part 1: Registers */ -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #endif /* __ASM_ARCH_MX35_REGS_H */ - diff --git a/arch/arm/mach-imx/include/mach/imx51-regs.h b/arch/arm/mach-imx/include/mach/imx51-regs.h index b51aa67c6f..c451004ecc 100644 --- a/arch/arm/mach-imx/include/mach/imx51-regs.h +++ b/arch/arm/mach-imx/include/mach/imx51-regs.h @@ -5,13 +5,6 @@ #define IMX_WDT_BASE 0x73f98000 #define IMX_IOMUXC_BASE 0x73fa8000 -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - /* WEIM registers */ #define WEIM_CSxGCR1(n) (((n) * 0x18) + 0x00) #define WEIM_CSxGCR2(n) (((n) * 0x18) + 0x04) @@ -22,18 +15,6 @@ #define WEIM_WIAR 0x94 #define WEIM_EAR 0x98 -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #define MX51_IROM_BASE_ADDR 0x0 /* diff --git a/arch/arm/mach-imx/include/mach/imx53-regs.h b/arch/arm/mach-imx/include/mach/imx53-regs.h index 8fefc5463e..e57d1abdd0 100644 --- a/arch/arm/mach-imx/include/mach/imx53-regs.h +++ b/arch/arm/mach-imx/include/mach/imx53-regs.h @@ -5,25 +5,6 @@ #define IMX_WDT_BASE 0X53F98000 #define IMX_IOMUXC_BASE 0X53FA8000 -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #define MX53_IROM_BASE_ADDR 0x0 /* diff --git a/arch/arm/mach-imx/include/mach/imx6-regs.h b/arch/arm/mach-imx/include/mach/imx6-regs.h index c7b7481d0f..eca4fa663a 100644 --- a/arch/arm/mach-imx/include/mach/imx6-regs.h +++ b/arch/arm/mach-imx/include/mach/imx6-regs.h @@ -5,25 +5,6 @@ #define IMX_WDT_BASE 0x020bc000 #define IMX_IOMUXC_BASE 0x020e0000 -#define GPT_TCTL 0x00 -#define GPT_TPRER 0x04 -#define GPT_TCMP 0x10 -#define GPT_TCR 0x1c -#define GPT_TCN 0x24 -#define GPT_TSTAT 0x08 - -/* Part 2: Bitfields */ -#define TCTL_SWR (1<<15) /* Software reset */ -#define TCTL_FRR (1<<9) /* Freerun / restart */ -#define TCTL_CAP (3<<6) /* Capture Edge */ -#define TCTL_OM (1<<5) /* output mode */ -#define TCTL_IRQEN (1<<4) /* interrupt enable */ -#define TCTL_CLKSOURCE (6) /* Clock source bit position */ -#define TCTL_TEN (1) /* Timer enable */ -#define TPRER_PRES (0xff) /* Prescale */ -#define TSTAT_CAPT (1<<1) /* Capture event */ -#define TSTAT_COMP (1) /* Compare event */ - #define MX6_AIPS1_ARB_BASE_ADDR 0x02000000 #define MX6_AIPS2_ARB_BASE_ADDR 0x02100000 diff --git a/arch/arm/mach-imx/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c index d952caad1e..948b610b10 100644 --- a/arch/arm/mach-imx/iomux-v3.c +++ b/arch/arm/mach-imx/iomux-v3.c @@ -33,6 +33,10 @@ int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad) u32 pad_ctrl_ofs = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT; u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT; + debug("%s: mux 0x%08x -> 0x%04x pad: 0x%08x -> 0x%04x sel_inp: 0x%08x -> 0x%04x\n", + __func__, mux_mode, mux_ctrl_ofs, pad_ctrl, pad_ctrl_ofs, sel_input, + sel_input_ofs); + if (mux_ctrl_ofs) __raw_writel(mux_mode, base + mux_ctrl_ofs); diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 6f324a0af8..ff295f144c 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -4,6 +4,7 @@ config ARCH_TEXT_BASE hex default 0x41000000 if MACH_MX23EVK default 0x42000000 if MACH_CHUMBY + default 0x42000000 if MACH_IMX233_OLINUXINO default 0x47000000 if MACH_TX28 default 0x47000000 if MACH_MX28EVK default 0x47000000 if MACH_CFA10036 @@ -11,6 +12,7 @@ config ARCH_TEXT_BASE config BOARDINFO default "Freescale i.MX23-EVK" if MACH_MX23EVK default "Chumby Falconwing" if MACH_CHUMBY + default "Olimex.ltd imx233-olinuxino" if MACH_IMX233_OLINUXINO default "Karo TX28" if MACH_TX28 default "Freescale i.MX28-EVK" if MACH_MX28EVK default "Crystalfontz CFA-10036" if MACH_CFA10036 @@ -47,6 +49,11 @@ config MACH_CHUMBY Say Y here if you are using the "chumby one" aka falconwing from Chumby Industries +config MACH_IMX233_OLINUXINO + bool "Olimex.ltd imx223-olinuxino" + help + Say Y here if you are using the imx233-olinuxino + endchoice endif diff --git a/arch/arm/mach-mxs/imx.c b/arch/arm/mach-mxs/imx.c index 599a510aea..ab32f10351 100644 --- a/arch/arm/mach-mxs/imx.c +++ b/arch/arm/mach-mxs/imx.c @@ -16,6 +16,30 @@ #include <common.h> #include <command.h> #include <complete.h> +#include <init.h> +#include <io.h> +#include <mach/imx-regs.h> + +#define HW_RTC_PERSISTENT1 0x070 + +static int imx_reset_usb_bootstrap(void) +{ + /* + * Clear USB boot mode. + * + * When the i.MX28 boots from USB, the ROM code sets this bit. When + * after a reset the ROM code detects that this bit is set it will + * boot from USB again. This means that if we boot once from USB the + * chip will continue to boot from USB until the next power cycle. + * + * To prevent this (and boot from the configured bootsource instead) + * clear this bit here. + */ + writel(0x2, IMX_WDT_BASE + HW_RTC_PERSISTENT1 + BIT_CLR); + + return 0; +} +device_initcall(imx_reset_usb_bootstrap); extern void imx_dump_clocks(void); diff --git a/arch/arm/mach-nomadik/8815.c b/arch/arm/mach-nomadik/8815.c index d935026fbe..81c5ce16d8 100644 --- a/arch/arm/mach-nomadik/8815.c +++ b/arch/arm/mach-nomadik/8815.c @@ -21,6 +21,7 @@ #include <mach/hardware.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <linux/amba/bus.h> #include "clock.h" @@ -28,12 +29,15 @@ static struct clk st8815_clk_48 = { .rate = 48 * 1000 * 1000, }; +static struct clk st8815_dummy; + void st8815_add_device_sdram(u32 size) { arm_add_mem_device("ram0", 0x00000000, size); } static struct clk_lookup clocks_lookups[] = { + CLKDEV_CON_ID("apb_pclk", &st8815_dummy), CLKDEV_DEV_ID("uart-pl0110", &st8815_clk_48), CLKDEV_DEV_ID("uart-pl0111", &st8815_clk_48), }; @@ -49,7 +53,6 @@ postcore_initcall(st8815_clkdev_init); void st8815_register_uart(unsigned id) { resource_size_t start; - struct device_d *dev; switch (id) { case 0: @@ -59,7 +62,5 @@ void st8815_register_uart(unsigned id) start = NOMADIK_UART1_BASE; break; } - dev = add_generic_device("uart-pl011", id, NULL, start, 4096, - IORESOURCE_MEM, NULL); - nmdk_clk_create(&st8815_clk_48, dev_name(dev)); + amba_apb_device_add(NULL, "uart-pl011", id, start, 4096, NULL, 0); } diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index 7abed0f8be..c0d02efc77 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -48,20 +48,7 @@ config ARCH_OMAP4 endchoice -### Generic Clock configurations to be enabled by Mach - invisible to enable. -config OMAP_CLOCK_UART - bool -config OMAP_CLOCK_UART2 - bool -config OMAP_CLOCK_UART3 - bool -config OMAP_CLOCK_I2C - bool - # Blind enable all possible clocks.. think twice before you do this. -config OMAP_CLOCK_ALL - bool - config OMAP_CLOCK_SOURCE_S32K bool @@ -87,6 +74,13 @@ config OMAP_BUILD_IFT prompt "build ift binary" bool +config OMAP_BUILD_SPI + prompt "build SPI binary" + bool + help + Say Y here if you want to build an barebox.spi image as used + on the AM35xx chips when booting form SPI NOR flash. + config ARCH_TEXT_BASE hex default 0x80e80000 if MACH_OMAP343xSDP @@ -106,14 +100,12 @@ choice config MACH_OMAP343xSDP bool "Texas Instrument's SDP343x" - select OMAP_CLOCK_ALL depends on ARCH_OMAP3 help Say Y here if you are using SDP343x platform config MACH_BEAGLE bool "Texas Instrument's Beagle Board" - select OMAP_CLOCK_ALL select HAVE_NOSHELL depends on ARCH_OMAP3 help @@ -121,7 +113,6 @@ config MACH_BEAGLE config MACH_OMAP3EVM bool "Texas Instrument's OMAP3 EVM" - select OMAP_CLOCK_ALL select HAVE_NOSHELL depends on ARCH_OMAP3 help @@ -146,7 +137,6 @@ config MACH_PCM049 config MACH_PCAAL1 bool "Phytec phyCARD-A-L1" - select OMAP_CLOCK_ALL select HAVE_NOSHELL depends on ARCH_OMAP3 help diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c index bb5f30f355..ff49708b15 100644 --- a/arch/arm/mach-omap/gpio.c +++ b/arch/arm/mach-omap/gpio.c @@ -32,11 +32,10 @@ * published by the Free Software Foundation. */ #include <common.h> -#include <mach/gpio.h> #include <io.h> #include <errno.h> - -#ifdef CONFIG_ARCH_OMAP3 +#include <gpio.h> +#include <init.h> #define OMAP_GPIO_OE 0x0034 #define OMAP_GPIO_DATAIN 0x0038 @@ -44,129 +43,115 @@ #define OMAP_GPIO_CLEARDATAOUT 0x0090 #define OMAP_GPIO_SETDATAOUT 0x0094 -static void __iomem *gpio_bank[] = { - (void *)0x48310000, - (void *)0x49050000, - (void *)0x49052000, - (void *)0x49054000, - (void *)0x49056000, - (void *)0x49058000, -}; -#endif - -#ifdef CONFIG_ARCH_OMAP4 - -#define OMAP_GPIO_OE 0x0134 -#define OMAP_GPIO_DATAIN 0x0138 -#define OMAP_GPIO_DATAOUT 0x013c -#define OMAP_GPIO_CLEARDATAOUT 0x0190 -#define OMAP_GPIO_SETDATAOUT 0x0194 - -static void __iomem *gpio_bank[] = { - (void *)0x4a310000, - (void *)0x48055000, - (void *)0x48057000, - (void *)0x48059000, - (void *)0x4805b000, - (void *)0x4805d000, +struct omap_gpio_chip { + void __iomem *base; + struct gpio_chip chip; }; -#endif - -static inline void __iomem *get_gpio_base(int gpio) -{ - return gpio_bank[gpio >> 5]; -} -static inline int get_gpio_index(int gpio) +static inline int omap_get_gpio_index(int gpio) { return gpio & 0x1f; } -static inline int gpio_valid(int gpio) +static void omap_gpio_set_value(struct gpio_chip *chip, + unsigned gpio, int value) { - if (gpio < 0) - return -1; - if (gpio / 32 < ARRAY_SIZE(gpio_bank)) - return 0; - return -1; -} - -static int check_gpio(int gpio) -{ - if (gpio_valid(gpio) < 0) { - printf("ERROR : check_gpio: invalid GPIO %d\n", gpio); - return -1; - } - return 0; -} - -void gpio_set_value(unsigned gpio, int value) -{ - void __iomem *reg; + struct omap_gpio_chip *omapgpio = + container_of(chip, struct omap_gpio_chip, chip); + void __iomem *base = omapgpio->base; u32 l = 0; - if (check_gpio(gpio) < 0) - return; - - reg = get_gpio_base(gpio); - if (value) - reg += OMAP_GPIO_SETDATAOUT; + base += OMAP_GPIO_SETDATAOUT; else - reg += OMAP_GPIO_CLEARDATAOUT; - l = 1 << get_gpio_index(gpio); + base += OMAP_GPIO_CLEARDATAOUT; + + l = 1 << omap_get_gpio_index(gpio); - __raw_writel(l, reg); + writel(l, base); } -int gpio_direction_input(unsigned gpio) +static int omap_gpio_direction_input(struct gpio_chip *chip, + unsigned gpio) { - void __iomem *reg; + struct omap_gpio_chip *omapgpio = + container_of(chip, struct omap_gpio_chip, chip); + void __iomem *base = omapgpio->base; u32 val; - if (check_gpio(gpio) < 0) - return -EINVAL; - - reg = get_gpio_base(gpio); - - reg += OMAP_GPIO_OE; + base += OMAP_GPIO_OE; - val = __raw_readl(reg); - val |= 1 << get_gpio_index(gpio); - __raw_writel(val, reg); + val = readl(base); + val |= 1 << omap_get_gpio_index(gpio); + writel(val, base); return 0; } -int gpio_direction_output(unsigned gpio, int value) +static int omap_gpio_direction_output(struct gpio_chip *chip, + unsigned gpio, int value) { - void __iomem *reg; + struct omap_gpio_chip *omapgpio = + container_of(chip, struct omap_gpio_chip, chip); + void __iomem *base = omapgpio->base; u32 val; - if (check_gpio(gpio) < 0) - return -EINVAL; - reg = get_gpio_base(gpio); + omap_gpio_set_value(chip, gpio, value); - gpio_set_value(gpio, value); + base += OMAP_GPIO_OE; - reg += OMAP_GPIO_OE; - - val = __raw_readl(reg); - val &= ~(1 << get_gpio_index(gpio)); - __raw_writel(val, reg); + val = readl(base); + val &= ~(1 << omap_get_gpio_index(gpio)); + writel(val, base); return 0; } -int gpio_get_value(unsigned gpio) +static int omap_gpio_get_value(struct gpio_chip *chip, unsigned gpio) +{ + struct omap_gpio_chip *omapgpio = + container_of(chip, struct omap_gpio_chip, chip); + void __iomem *base = omapgpio->base; + + base += OMAP_GPIO_DATAIN; + + return (readl(base) & (1 << omap_get_gpio_index(gpio))) != 0; + +} + +static struct gpio_ops omap_gpio_ops = { + .direction_input = omap_gpio_direction_input, + .direction_output = omap_gpio_direction_output, + .get = omap_gpio_get_value, + .set = omap_gpio_set_value, +}; + +static int omap_gpio_probe(struct device_d *dev) { - void __iomem *reg; + struct omap_gpio_chip *omapgpio; + + omapgpio = xzalloc(sizeof(*omapgpio)); + omapgpio->base = dev_request_mem_region(dev, 0); + omapgpio->chip.ops = &omap_gpio_ops; + omapgpio->chip.base = -1; + omapgpio->chip.ngpio = 32; + omapgpio->chip.dev = dev; + gpiochip_add(&omapgpio->chip); - if (check_gpio(gpio) < 0) - return -EINVAL; - reg = get_gpio_base(gpio); + dev_dbg(dev, "probed gpiochip%d with base %d\n", + dev->id, omapgpio->chip.base); + + return 0; +} - reg += OMAP_GPIO_DATAIN; +static struct driver_d omap_gpio_driver = { + .name = "omap-gpio", + .probe = omap_gpio_probe, +}; - return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0; +static int omap_gpio_add(void) +{ + register_driver(&omap_gpio_driver); + return 0; } +coredevice_initcall(omap_gpio_add); diff --git a/arch/arm/mach-omap/include/mach/emac_defs.h b/arch/arm/mach-omap/include/mach/emac_defs.h new file mode 100644 index 0000000000..568de6a12a --- /dev/null +++ b/arch/arm/mach-omap/include/mach/emac_defs.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> + * + * Based on: + * + * ---------------------------------------------------------------------------- + * + * dm644x_emac.h + * + * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM + * + * Copyright (C) 2005 Texas Instruments. + * + * ---------------------------------------------------------------------------- + * + * 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * ---------------------------------------------------------------------------- + + * Modifications: + * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot. + * + */ + +#ifndef _AM3517_EMAC_H_ +#define _AM3517_EMAC_H_ + +#define EMAC_BASE_ADDR 0x5C010000 +#define EMAC_WRAPPER_BASE_ADDR 0x5C000000 +#define EMAC_WRAPPER_RAM_ADDR 0x5C020000 +#define EMAC_MDIO_BASE_ADDR 0x5C030000 +#define EMAC_HW_RAM_ADDR 0x01E20000 + +#define EMAC_MDIO_BUS_FREQ 166000000 /* 166 MHZ check */ +#define EMAC_MDIO_CLOCK_FREQ 1000000 /* 2.0 MHz */ + +#endif /* _AM3517_EMAC_H_ */ diff --git a/arch/arm/mach-omap/include/mach/xload.h b/arch/arm/mach-omap/include/mach/xload.h index 844b57f0e5..63b68df15c 100644 --- a/arch/arm/mach-omap/include/mach/xload.h +++ b/arch/arm/mach-omap/include/mach/xload.h @@ -1,13 +1,11 @@ #ifndef _MACH_XLOAD_H #define _MACH_XLOAD_H -void *omap_xload_boot_nand(int offset, int size); -void *omap_xload_boot_mmc(void); - enum omap_boot_src { OMAP_BOOTSRC_UNKNOWN, OMAP_BOOTSRC_MMC1, OMAP_BOOTSRC_NAND, + OMAP_BOOTSRC_SPI1, }; enum omap_boot_src omap3_bootsrc(void); diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c index d129f5a71c..cfac7bc17f 100644 --- a/arch/arm/mach-omap/omap3_clock.c +++ b/arch/arm/mach-omap/omap3_clock.c @@ -670,18 +670,6 @@ static void per_clocks_enable(void) /* Enable the ICLK for 32K Sync Timer as its used in udelay */ sr32(CM_REG(ICLKEN_WKUP), 2, 1, 0x1); -#ifdef CONFIG_OMAP_CLOCK_UART - /* Enable UART1 clocks */ - sr32(CM_REG(FCLKEN1_CORE), 13, 1, 0x1); - sr32(CM_REG(ICLKEN1_CORE), 13, 1, 0x1); -#endif -#ifdef CONFIG_OMAP_CLOCK_I2C - /* Turn on all 3 I2C clocks */ - sr32(CM_REG(FCLKEN1_CORE), 15, 3, 0x7); - sr32(CM_REG(ICLKEN1_CORE), 15, 3, 0x7); /* I2C1,2,3 = on */ -#endif - -#ifdef CONFIG_OMAP_CLOCK_ALL #define FCK_IVA2_ON 0x00000001 #define FCK_CORE1_ON 0x03fffe29 #define ICK_CORE1_ON 0x3ffffffb @@ -706,7 +694,7 @@ static void per_clocks_enable(void) sr32(CM_REG(ICLKEN_CAM), 0, 32, ICK_CAM_ON); sr32(CM_REG(FCLKEN_PER), 0, 32, FCK_PER_ON); sr32(CM_REG(ICLKEN_PER), 0, 32, ICK_PER_ON); -#endif + /* Settle down my friend */ sdelay(1000); } diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c index af26af4f5d..5028e9a9e6 100644 --- a/arch/arm/mach-omap/omap3_generic.c +++ b/arch/arm/mach-omap/omap3_generic.c @@ -511,3 +511,22 @@ const struct gpmc_config omap3_nand_cfg = { .base = 0x28000000, .size = GPMC_SIZE_16M, }; + +static int omap3_gpio_init(void) +{ + add_generic_device("omap-gpio", 0, NULL, 0x48310000, + 0x100, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 1, NULL, 0x49050000, + 0x100, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 2, NULL, 0x49052000, + 0x100, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 3, NULL, 0x49054000, + 0x100, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 4, NULL, 0x49056000, + 0x100, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 5, NULL, 0x49058000, + 0x100, IORESOURCE_MEM, NULL); + + return 0; +} +coredevice_initcall(omap3_gpio_init); diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c index 617d786984..a159dfcb7e 100644 --- a/arch/arm/mach-omap/omap4_generic.c +++ b/arch/arm/mach-omap/omap4_generic.c @@ -572,3 +572,22 @@ const struct gpmc_config omap4_nand_cfg = { .base = 0x28000000, .size = GPMC_SIZE_16M, }; + +static int omap4_gpio_init(void) +{ + add_generic_device("omap-gpio", 0, NULL, 0x4a310100, + 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 1, NULL, 0x48055100, + 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 2, NULL, 0x48057100, + 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 3, NULL, 0x48059100, + 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 4, NULL, 0x4805b100, + 0x1000, IORESOURCE_MEM, NULL); + add_generic_device("omap-gpio", 5, NULL, 0x4805d100, + 0x1000, IORESOURCE_MEM, NULL); + + return 0; +} +coredevice_initcall(omap4_gpio_init); diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index 13024abac7..9fa8221ec9 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -7,16 +7,65 @@ #include <fcntl.h> #include <mach/xload.h> #include <sizes.h> +#include <filetype.h> -void *omap_xload_boot_nand(int offset, int size) +static void *read_image_head(const char *name) { + void *header = xmalloc(ARM_HEAD_SIZE); + struct cdev *cdev; int ret; - void *to = xmalloc(size); + + cdev = cdev_open(name, O_RDONLY); + if (!cdev) { + printf("failed to open partition\n"); + return NULL; + } + + ret = cdev_read(cdev, header, ARM_HEAD_SIZE, 0, 0); + cdev_close(cdev); + + if (ret != ARM_HEAD_SIZE) { + printf("failed to read from partition\n"); + return NULL; + } + + return header; +} + +static unsigned int get_image_size(void *head) +{ + unsigned int ret = 0; + unsigned int *psize = head + ARM_HEAD_SIZE_OFFSET; + + if (is_barebox_arm_head(head)) + ret = *psize; + debug("Detected barebox image size %u\n", ret); + + return ret; +} + +static void *omap_xload_boot_nand(int offset) +{ + int ret; + int size; + void *to, *header; struct cdev *cdev; - devfs_add_partition("nand0", offset, size, DEVFS_PARTITION_FIXED, "x"); + devfs_add_partition("nand0", offset, SZ_1M, DEVFS_PARTITION_FIXED, "x"); dev_add_bb_dev("x", "bbx"); + header = read_image_head("bbx"); + if (header == NULL) + return NULL; + + size = get_image_size(header); + if (!size) { + printf("failed to get image size\n"); + return NULL; + } + + to = xmalloc(size); + cdev = cdev_open("bbx", O_RDONLY); if (!cdev) { printf("failed to open nand\n"); @@ -32,7 +81,7 @@ void *omap_xload_boot_nand(int offset, int size) return to; } -void *omap_xload_boot_mmc(void) +static void *omap_xload_boot_mmc(void) { int ret; void *buf; @@ -54,6 +103,42 @@ void *omap_xload_boot_mmc(void) return buf; } +static void *omap_xload_boot_spi(int offset) +{ + int ret; + int size; + void *to, *header; + struct cdev *cdev; + + devfs_add_partition("m25p0", offset, SZ_1M, DEVFS_PARTITION_FIXED, "x"); + + header = read_image_head("x"); + if (header == NULL) + return NULL; + + size = get_image_size(header); + if (!size) { + printf("failed to get image size\n"); + return NULL; + } + + to = xmalloc(size); + + cdev = cdev_open("x", O_RDONLY); + if (!cdev) { + printf("failed to open spi flash\n"); + return NULL; + } + + ret = cdev_read(cdev, to, size, 0, 0); + if (ret != size) { + printf("failed to read from spi flash\n"); + return NULL; + } + + return to; +} + enum omap_boot_src omap_bootsrc(void) { #if defined(CONFIG_ARCH_OMAP3) @@ -80,7 +165,11 @@ int run_shell(void) printf("unknown boot source. Fall back to nand\n"); case OMAP_BOOTSRC_NAND: printf("booting from NAND\n"); - func = omap_xload_boot_nand(SZ_128K, SZ_256K); + func = omap_xload_boot_nand(SZ_128K); + break; + case OMAP_BOOTSRC_SPI1: + printf("booting from SPI1\n"); + func = omap_xload_boot_spi(SZ_128K); break; } diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 02a5f97272..5c75e11e98 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -30,6 +30,7 @@ #include <linux/clkdev.h> #include <linux/clk.h> #include <linux/err.h> +#include <linux/amba/bus.h> #include <io.h> #include <asm/hardware/arm_timer.h> @@ -47,6 +48,8 @@ struct clk { unsigned long rate; }; +static struct clk ref_clk_dummy; + static struct clk ref_clk_24 = { .rate = 24000000, }; @@ -141,6 +144,7 @@ static int vpb_clocksource_init(void) core_initcall(vpb_clocksource_init); static struct clk_lookup clocks_lookups[] = { + CLKDEV_CON_ID("apb_pclk", &ref_clk_dummy), CLKDEV_DEV_ID("uart-pl0110", &ref_clk_24), CLKDEV_DEV_ID("uart-pl0111", &ref_clk_24), CLKDEV_DEV_ID("uart-pl0112", &ref_clk_24), @@ -175,8 +179,7 @@ void versatile_register_uart(unsigned id) default: return; } - add_generic_device("uart-pl011", id, NULL, start, 4096, - IORESOURCE_MEM, NULL); + amba_apb_device_add(NULL, "uart-pl011", id, start, 4096, NULL, 0); } void __noreturn reset_cpu (unsigned long ignored) diff --git a/arch/arm/pbl/zbarebox.lds.S b/arch/arm/pbl/zbarebox.lds.S index 2dca278318..37af4e913e 100644 --- a/arch/arm/pbl/zbarebox.lds.S +++ b/arch/arm/pbl/zbarebox.lds.S @@ -39,8 +39,6 @@ SECTIONS _stext = .; _text = .; *(.text_head_entry*) - __ll_return = .; - *(.text_ll_return*) __bare_init_start = .; *(.text_bare_init*) __bare_init_end = .; diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h index 9819a973e7..620c207a03 100644 --- a/arch/nios2/include/asm/dma-mapping.h +++ b/arch/nios2/include/asm/dma-mapping.h @@ -6,7 +6,6 @@ #include <asm/cache.h> - /* dma_alloc_coherent() return cache-line aligned allocation which is mapped * to uncached io region. * @@ -14,6 +13,7 @@ * 0x80000000 for nommu, 0xe0000000 for mmu */ +#if (DCACHE_SIZE != 0) static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) { void *addr = malloc(len + DCACHE_LINE_SIZE); @@ -25,11 +25,23 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) ~(DCACHE_LINE_SIZE - 1) & ~(IO_REGION_BASE); return (void *)(*handle | IO_REGION_BASE); } +#else +static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) +{ + void *addr = malloc(len); + if (!addr) + return 0; + *handle = (unsigned long)addr; + return (void *)(*handle | IO_REGION_BASE); +} +#endif +#if (DCACHE_SIZE != 0) #define dma_alloc dma_alloc static inline void *dma_alloc(size_t size) { return xmemalign(DCACHE_LINE_SIZE, ALIGN(size, DCACHE_LINE_SIZE)); } +#endif #endif /* __ASM_NIOS2_DMA_MAPPING_H */ diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile index 1f4b1755d4..fd8bbbf4d7 100644 --- a/arch/openrisc/Makefile +++ b/arch/openrisc/Makefile @@ -1,7 +1,5 @@ CPPFLAGS += -D__OR1K__ -ffixed-r10 -mhard-mul -mhard-div -LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) - board-$(CONFIG_GENERIC) := generic KALLSYMS += --symbol-prefix=_ @@ -20,6 +18,4 @@ common-y += $(BOARD) common-y += arch/openrisc/lib/ common-y += arch/openrisc/cpu/ -common-y += $(LIBGCC) - lds-y += arch/openrisc/cpu/barebox.lds diff --git a/arch/openrisc/lib/Makefile b/arch/openrisc/lib/Makefile index aaf93cbd20..0b3cc5068c 100644 --- a/arch/openrisc/lib/Makefile +++ b/arch/openrisc/lib/Makefile @@ -4,3 +4,4 @@ obj-y += cpuinfo.o obj-y += muldi3.o obj-y += lshrdi3.o obj-y += ashldi3.o +obj-y += ashrdi3.o diff --git a/arch/openrisc/lib/ashrdi3.S b/arch/openrisc/lib/ashrdi3.S new file mode 100644 index 0000000000..c656d9fb6e --- /dev/null +++ b/arch/openrisc/lib/ashrdi3.S @@ -0,0 +1,59 @@ +/* + * (C) Copyright 2012 - Franck JULLIEN <elec4fun@gmail.com> + * + * Extracted from gcc generated assembly. + * + * Extended precision shifts. + * + * R3/R4 (MSW, LSW) has 64 bit value + * R5 has shift count + * result in R11/R12 + * + * 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, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + + +.globl __ashrdi3 + +__ashrdi3: + l.sfeqi r5,0x0 /* if count = 0, go out */ + l.bf out + + l.addi r6,r0,0x20 /* r6 = 32 */ + l.sub r6,r6,r5 /* r6 = 32 - count */ + l.sfgtsi r6,0x0 /* if count >= 32 */ + l.bnf more_than_32 /* branch to more_than_32 */ + l.nop 0x0 + + + less_than_32: + l.sll r6,r3,r6 /* r6 gets the bits moved from MSW to LSW */ + l.srl r4,r4,r5 /* shift LSW */ + l.sra r5,r3,r5 /* shift MSW to r5 */ + l.or r4,r6,r4 /* LSW gets bits shifted from MSW */ + l.ori r3,r5,0x0 /* r3 = MSW */ + + out: + l.ori r11,r3,0x0 + l.jr r9 + l.ori r12,r4,0x0 + + more_than_32: + l.srai r5,r3,0x1f /* r5 = MSW sign extended */ + l.sub r4,r0,r6 /* r4 = -r6, the number of bits above 32 */ + l.sra r4,r3,r4 /* LSW gets bits shifted from MSB */ + l.j out /* go out */ + l.ori r3,r5,0x0 /* r3 = MSW */ diff --git a/arch/ppc/boards/pcm030/pcm030.c b/arch/ppc/boards/pcm030/pcm030.c index 01becdef99..ae7f7f8c96 100644 --- a/arch/ppc/boards/pcm030/pcm030.c +++ b/arch/ppc/boards/pcm030/pcm030.c @@ -26,8 +26,7 @@ #include <common.h> #include <driver.h> #include <init.h> -#include <mach/mpc5xxx.h> -#include <mach/fec.h> +#include <fec.h> #include <types.h> #include <partition.h> #include <memory.h> @@ -35,7 +34,7 @@ #include <linux/stat.h> #include <fs.h> -static struct mpc5xxx_fec_platform_data fec_info = { +static struct fec_platform_data fec_info = { .xcv_type = MII100, }; diff --git a/arch/ppc/mach-mpc5xxx/include/mach/fec.h b/arch/ppc/mach-mpc5xxx/include/mach/fec.h deleted file mode 100644 index a3e04b4e9d..0000000000 --- a/arch/ppc/mach-mpc5xxx/include/mach/fec.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __INCLUDE_ASM_ARCH_FEC_H -#define __INCLUDE_ASM_ARCH_FEC_H - -struct mpc5xxx_fec_platform_data { - ulong xcv_type; -}; - -typedef enum { - SEVENWIRE, /* 7-wire */ - MII10, /* MII 10Mbps */ - MII100 /* MII 100Mbps */ -} xceiver_type; - -#endif /* __INCLUDE_ASM_ARCH_FEC_H */ diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile index 266c3a3cec..5104f5cb26 100644 --- a/arch/sandbox/board/Makefile +++ b/arch/sandbox/board/Makefile @@ -2,5 +2,6 @@ obj-y += board.o obj-y += clock.o obj-y += hostfile.o obj-y += console.o +obj-y += devices.o extra-y += barebox.lds diff --git a/arch/sandbox/board/console.c b/arch/sandbox/board/console.c index 18b63e1d2d..b0afa54d95 100644 --- a/arch/sandbox/board/console.c +++ b/arch/sandbox/board/console.c @@ -44,6 +44,6 @@ int barebox_register_console(char *name, int stdinfd, int stdoutfd) data->stdoutfd = stdoutfd; data->stdinfd = stdinfd; - return register_device(dev); + return sandbox_add_device(dev); } diff --git a/arch/sandbox/board/devices.c b/arch/sandbox/board/devices.c new file mode 100644 index 0000000000..dba0d5d893 --- /dev/null +++ b/arch/sandbox/board/devices.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> + * + * Under GPLv2 only + */ + +#include <common.h> +#include <driver.h> +#include <init.h> + +static LIST_HEAD(sandbox_device_list); + +int sandbox_add_device(struct device_d *dev) +{ + list_add(&dev->list, &sandbox_device_list); + + return 0; +} + +static int sandbox_device_init(void) +{ + struct device_d *dev, *tmp; + + list_for_each_entry_safe(dev, tmp, &sandbox_device_list, list) { + /* reset the list_head before registering for real */ + dev->list.prev = NULL; + dev->list.next = NULL; + register_device(dev); + } + + return 0; +} +postcore_initcall(sandbox_device_init); diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c index f5acc785ec..2cc7c1fbde 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -99,7 +99,22 @@ device_initcall(hf_init); int barebox_register_filedev(struct hf_platform_data *hf) { - return !add_generic_device("hostfile", DEVICE_ID_DYNAMIC, NULL, hf->base, hf->size, - IORESOURCE_MEM, hf); + struct device_d *dev; + struct resource *res; + + dev = xzalloc(sizeof(*dev)); + strcpy(dev->name, "hostfile"); + dev->id = DEVICE_ID_DYNAMIC; + dev->platform_data = hf; + + res = xzalloc(sizeof(struct resource)); + res[0].start = hf->base; + res[0].end = hf->base + hf->size - 1; + res[0].flags = IORESOURCE_MEM; + + dev->resource = res; + dev->num_resources = 1; + + return sandbox_add_device(dev); } diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h index 5917fe93de..259f2d8ee3 100644 --- a/arch/sandbox/mach-sandbox/include/mach/linux.h +++ b/arch/sandbox/mach-sandbox/include/mach/linux.h @@ -1,6 +1,9 @@ #ifndef __ASM_ARCH_LINUX_H #define __ASM_ARCH_LINUX_H +struct device_d; + +int sandbox_add_device(struct device_d *dev); int linux_register_device(const char *name, void *start, void *end); int tap_alloc(char *dev); uint64_t linux_get_time(void); diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index 35bcf9d8bb..0a4b96a63e 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -352,10 +352,6 @@ int main(int argc, char *argv[]) break; switch (opt) { - case 'h': - break; - case 'm': - break; case 'i': sprintf(str, "fd%d", fdno); ret = add_image(optarg, str); @@ -363,14 +359,8 @@ int main(int argc, char *argv[]) exit(1); fdno++; break; - case 'e': - break; - case 'O': - break; - case 'I': - break; default: - exit(1); + break; } } |