diff options
Diffstat (limited to 'arch')
107 files changed, 1619 insertions, 624 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f02b1602d8..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,20 @@ 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 $@ @@ -230,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/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_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/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-mx28-evk/mx28-evk.c b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c index 1283e1769a..7cd61f9e96 100644 --- a/arch/arm/boards/freescale-mx28-evk/mx28-evk.c +++ b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c @@ -224,19 +224,19 @@ static int mx28_evk_devices_init(void) armlinux_set_bootparams((void *)IMX_MEMORY_BASE + 0x100); armlinux_set_architecture(MACH_TYPE_MX28EVK); - add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0, + add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0x2000, IORESOURCE_MEM, &mci_pdata); - add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 4096, + add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 0x2000, IORESOURCE_MEM, &mx28_evk_fb_pdata); - add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0, + add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0x2000, IORESOURCE_MEM, NULL); mx28_evk_get_ethaddr(); /* must be after registering ocotp */ imx_enable_enetclk(); mx28_evk_fec_reset(); - add_generic_device("fec_imx", 0, NULL, IMX_FEC0_BASE, 0, + add_generic_device("fec_imx", 0, NULL, IMX_FEC0_BASE, 0x4000, IORESOURCE_MEM, &fec_info); return 0; @@ -245,7 +245,7 @@ device_initcall(mx28_evk_devices_init); static int mx28_evk_console_init(void) { - add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 8192, + add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 0x2000, IORESOURCE_MEM, NULL); return 0; 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 e4a9a49b55..0e853a6926 100644 --- a/arch/arm/boards/freescale-mx6-arm2/board.c +++ b/arch/arm/boards/freescale-mx6-arm2/board.c @@ -26,7 +26,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> @@ -104,50 +104,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 1ac401ebb1..6070e2e167 100644 --- a/arch/arm/boards/freescale-mx6-sabrelite/board.c +++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c @@ -28,7 +28,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> @@ -40,6 +40,7 @@ #include <mach/gpio.h> #include <spi/spi.h> #include <mach/spi.h> +#include <mach/usb.h> #define SABRELITE_SD3_WP IMX_GPIO_NR(7, 1) #define SABRELITE_SD3_CD IMX_GPIO_NR(7, 0) @@ -135,38 +136,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)); @@ -265,7 +255,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/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-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c index 04fdbc37b9..961787669b 100644 --- a/arch/arm/boards/karo-tx28/tx28-stk5.c +++ b/arch/arm/boards/karo-tx28/tx28-stk5.c @@ -376,7 +376,7 @@ void base_board_init(void) /* run the SSP unit clock at 100 MHz */ imx_set_sspclk(0, 100000000, 1); - add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0, + add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0x2000, IORESOURCE_MEM, &mci_pdata); if (tx28_fb_pdata.fixed_screen < (void *)&_end) { @@ -384,16 +384,16 @@ void base_board_init(void) tx28_fb_pdata.fixed_screen = NULL; } - add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 4096, + add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 0x2000, IORESOURCE_MEM, &tx28_fb_pdata); - add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0, + add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0x2000, IORESOURCE_MEM, NULL); tx28_get_ethaddr(); imx_enable_enetclk(); - add_generic_device("fec_imx", 0, NULL, IMX_FEC0_BASE, 0, + add_generic_device("fec_imx", 0, NULL, IMX_FEC0_BASE, 0x4000, IORESOURCE_MEM, &fec_info); ret = register_persistent_environment(); @@ -404,9 +404,9 @@ void base_board_init(void) static int tx28kit_console_init(void) { - add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 8192, + add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 0x2000, IORESOURCE_MEM, NULL); - + return 0; } 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/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/env/bin/nand_bootstrap b/arch/arm/boards/pcm049/env/bin/nand_bootstrap index f8873fabe2..49e38dc4f0 100644 --- a/arch/arm/boards/pcm049/env/bin/nand_bootstrap +++ b/arch/arm/boards/pcm049/env/bin/nand_bootstrap @@ -1,4 +1,4 @@ - +#!/bin/sh echo "copying barebox to nand..." mci0.probe=1 diff --git a/arch/arm/boards/pcm049/env/config b/arch/arm/boards/pcm049/env/config index 70e374f5ae..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" diff --git a/arch/arm/boards/phycard-a-l1/env/config b/arch/arm/boards/phycard-a-l1/env/config index 5bc48d7a8a..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 diff --git a/arch/arm/boards/phycard-a-xl2/env/config b/arch/arm/boards/phycard-a-xl2/env/config index 44a4181355..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" 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 614bfc65eb..53eec8f6b6 100644 --- a/arch/arm/boards/phycard-i.MX27/pca100.c +++ b/arch/arm/boards/phycard-i.MX27/pca100.c @@ -324,11 +324,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/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/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/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 07e7dfe822..1c6a7ddfcc 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -30,7 +30,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) @@ -47,6 +47,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(); @@ -56,22 +59,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 b880dd49b3..a71f420ed5 100644 --- a/arch/arm/include/asm/barebox-arm.h +++ b/arch/arm/include/asm/barebox-arm.h @@ -37,10 +37,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 9f9dea8754..74d59a9c0b 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -80,7 +80,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 } @@ -264,6 +264,7 @@ void start_linux(void *adr, int swap, unsigned long initrd_address, setup_tags(initrd_address, initrd_size, swap); params = armlinux_bootparams; } + architecture = armlinux_get_architecture(); shutdown_barebox(); if (swap) { @@ -273,8 +274,6 @@ void start_linux(void *adr, int swap, unsigned long initrd_address, __asm__ __volatile__("mcr p15, 0, %0, c1, c0" :: "r" (reg)); } - architecture = armlinux_get_architecture(); - #ifdef CONFIG_THUMB2_BAREBOX __asm__ __volatile__ ( "mov r0, #0\n" diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S index a69013f7f5..40af705730 100644 --- a/arch/arm/lib/barebox.lds.S +++ b/arch/arm/lib/barebox.lds.S @@ -40,8 +40,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 4e77ece7f3..c725f8c23a 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -32,17 +32,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 = { @@ -61,10 +89,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); @@ -85,9 +123,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); @@ -98,7 +134,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 8d5d4ce2b0..e78a36e219 100644 --- a/arch/arm/mach-imx/gpio.c +++ b/arch/arm/mach-imx/gpio.c @@ -30,28 +30,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) @@ -63,14 +63,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) @@ -82,9 +82,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; } @@ -98,9 +98,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; } @@ -111,7 +111,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; } @@ -126,23 +126,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 5a000bc96a..5dd71f50a3 100644 --- a/arch/arm/mach-imx/imx1.c +++ b/arch/arm/mach-imx/imx1.c @@ -20,10 +20,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 85590ee8f4..4973491f43 100644 --- a/arch/arm/mach-imx/imx21.c +++ b/arch/arm/mach-imx/imx21.c @@ -16,6 +16,7 @@ */ #include <common.h> +#include <init.h> #include <mach/imx-regs.h> int imx_silicon_revision(void) @@ -28,12 +29,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 d605022516..397ddde253 100644 --- a/arch/arm/mach-imx/imx25.c +++ b/arch/arm/mach-imx/imx25.c @@ -48,10 +48,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 c6e6942c58..6c8f3fcd5d 100644 --- a/arch/arm/mach-imx/imx27.c +++ b/arch/arm/mach-imx/imx27.c @@ -73,12 +73,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 90dc4e3180..08f9143765 100644 --- a/arch/arm/mach-imx/imx31.c +++ b/arch/arm/mach-imx/imx31.c @@ -25,9 +25,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 efbee985d3..7f49582b5a 100644 --- a/arch/arm/mach-imx/imx35.c +++ b/arch/arm/mach-imx/imx35.c @@ -56,9 +56,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 e43cc65ecd..117bda9c0a 100644 --- a/arch/arm/mach-imx/imx51.c +++ b/arch/arm/mach-imx/imx51.c @@ -78,10 +78,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 cb945753b0..9fc44e506c 100644 --- a/arch/arm/mach-imx/imx53.c +++ b/arch/arm/mach-imx/imx53.c @@ -74,13 +74,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 c693724a51..66c44e1391 100644 --- a/arch/arm/mach-imx/imx6.c +++ b/arch/arm/mach-imx/imx6.c @@ -58,13 +58,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 73307c452e..a35d9e3475 100644 --- a/arch/arm/mach-imx/include/mach/imx25-regs.h +++ b/arch/arm/mach-imx/include/mach/imx25-regs.h @@ -108,33 +108,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 536bf0dad4..062af751c8 100644 --- a/arch/arm/mach-imx/include/mach/imx31-regs.h +++ b/arch/arm/mach-imx/include/mach/imx31-regs.h @@ -57,33 +57,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 91d4b9bf52..5f000521f4 100644 --- a/arch/arm/mach-imx/include/mach/imx35-regs.h +++ b/arch/arm/mach-imx/include/mach/imx35-regs.h @@ -116,32 +116,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/include/mach/iomux-mx51.h b/arch/arm/mach-imx/include/mach/iomux-mx51.h index 36c8989d9d..0252d412c6 100644 --- a/arch/arm/mach-imx/include/mach/iomux-mx51.h +++ b/arch/arm/mach-imx/include/mach/iomux-mx51.h @@ -649,20 +649,20 @@ #define MX51_PAD_DI2_PIN2__DI2_PIN2 IOMUX_PAD(0x74c, 0x344, 0, __NA_, 0, NO_PAD_CTRL) #define MX51_PAD_DI2_PIN2__FEC_MDC IOMUX_PAD(0x74c, 0x344, 2, __NA_, 0, MX51_PAD_CTRL_5) #define MX51_PAD_DI2_PIN3__DI2_PIN3 IOMUX_PAD(0x750, 0x348, 0, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DI2_PIN3__FEC_MDIO IOMUX_PAD(0x750, 0x348, 2, 0x954, 1, NO_PAD_CTRL) +#define MX51_PAD_DI2_PIN3__FEC_MDIO IOMUX_PAD(0x750, 0x348, 2, 0x954, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK IOMUX_PAD(0x754, 0x34c, 0, __NA_, 0, NO_PAD_CTRL) #define MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 IOMUX_PAD(0x754, 0x34c, 2, 0x95c, 1, NO_PAD_CTRL) #define MX51_PAD_DI_GP4__DI2_PIN15 IOMUX_PAD(0x758, 0x350, 4, __NA_, 0, NO_PAD_CTRL) #define MX51_PAD_DI_GP4__DISP1_SER_DIN IOMUX_PAD(0x758, 0x350, 0, 0x9c0, 1, NO_PAD_CTRL) #define MX51_PAD_DI_GP4__DISP2_PIN1 IOMUX_PAD(0x758, 0x350, 3, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DI_GP4__FEC_RDATA2 IOMUX_PAD(0x758, 0x350, 2, 0x960, 1, NO_PAD_CTRL) +#define MX51_PAD_DI_GP4__FEC_RDATA2 IOMUX_PAD(0x758, 0x350, 2, 0x960, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT0__DISP2_DAT0 IOMUX_PAD(0x75c, 0x354, 0, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DISP2_DAT0__FEC_RDATA3 IOMUX_PAD(0x75c, 0x354, 2, 0x964, 1, NO_PAD_CTRL) +#define MX51_PAD_DISP2_DAT0__FEC_RDATA3 IOMUX_PAD(0x75c, 0x354, 2, 0x964, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT0__KEY_COL6 IOMUX_PAD(0x75c, 0x354, 4, 0x9c8, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT0__UART3_RXD IOMUX_PAD(0x75c, 0x354, 5, 0x9f4, 8, MX51_UART_PAD_CTRL) #define MX51_PAD_DISP2_DAT0__USBH3_CLK IOMUX_PAD(0x75c, 0x354, 3, 0x9f8, 1, MX51_UART_PAD_CTRL) #define MX51_PAD_DISP2_DAT1__DISP2_DAT1 IOMUX_PAD(0x760, 0x358, 0, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DISP2_DAT1__FEC_RX_ER IOMUX_PAD(0x760, 0x358, 2, 0x970, 1, NO_PAD_CTRL) +#define MX51_PAD_DISP2_DAT1__FEC_RX_ER IOMUX_PAD(0x760, 0x358, 2, 0x970, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT1__KEY_COL7 IOMUX_PAD(0x760, 0x358, 4, 0x9cc, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT1__UART3_TXD IOMUX_PAD(0x760, 0x358, 5, __NA_, 0, MX51_UART_PAD_CTRL) #define MX51_PAD_DISP2_DAT1__USBH3_DIR IOMUX_PAD(0x760, 0x358, 3, 0xa1c, 1, NO_PAD_CTRL) @@ -692,17 +692,17 @@ #define MX51_PAD_DISP2_DAT9__USBH3_DATA1 IOMUX_PAD(0x780, 0x378, 3, 0xa00, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT10__DISP2_DAT10 IOMUX_PAD(0x784, 0x37c, 0, __NA_, 0, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT10__DISP2_SER_CS IOMUX_PAD(0x784, 0x37c, 5, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DISP2_DAT10__FEC_COL IOMUX_PAD(0x784, 0x37c, 2, 0x94c, 1, NO_PAD_CTRL) +#define MX51_PAD_DISP2_DAT10__FEC_COL IOMUX_PAD(0x784, 0x37c, 2, 0x94c, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT10__KEY_ROW7 IOMUX_PAD(0x784, 0x37c, 4, 0x9dc, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT10__USBH3_DATA2 IOMUX_PAD(0x784, 0x37c, 3, 0xa04, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT11__AUD6_TXD IOMUX_PAD(0x788, 0x380, 4, 0x8f0, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT11__DISP2_DAT11 IOMUX_PAD(0x788, 0x380, 0, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DISP2_DAT11__FEC_RX_CLK IOMUX_PAD(0x788, 0x380, 2, 0x968, 1, NO_PAD_CTRL) +#define MX51_PAD_DISP2_DAT11__FEC_RX_CLK IOMUX_PAD(0x788, 0x380, 2, 0x968, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT11__GPIO1_10 IOMUX_PAD(0x788, 0x380, 7, __NA_, 0, MX51_GPIO_PAD_CTRL) #define MX51_PAD_DISP2_DAT11__USBH3_DATA3 IOMUX_PAD(0x788, 0x380, 3, 0xa08, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT12__AUD6_RXD IOMUX_PAD(0x78c, 0x384, 4, 0x8ec, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT12__DISP2_DAT12 IOMUX_PAD(0x78c, 0x384, 0, __NA_, 0, NO_PAD_CTRL) -#define MX51_PAD_DISP2_DAT12__FEC_RX_DV IOMUX_PAD(0x78c, 0x384, 2, 0x96c, 1, NO_PAD_CTRL) +#define MX51_PAD_DISP2_DAT12__FEC_RX_DV IOMUX_PAD(0x78c, 0x384, 2, 0x96c, 1, MX51_PAD_CTRL_5) #define MX51_PAD_DISP2_DAT12__USBH3_DATA4 IOMUX_PAD(0x78c, 0x384, 3, 0xa0c, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT13__AUD6_TXC IOMUX_PAD(0x790, 0x388, 4, 0x8fc, 1, NO_PAD_CTRL) #define MX51_PAD_DISP2_DAT13__DISP2_DAT13 IOMUX_PAD(0x790, 0x388, 0, __NA_, 0, NO_PAD_CTRL) diff --git a/arch/arm/mach-imx/include/mach/usb.h b/arch/arm/mach-imx/include/mach/usb.h index 5d6670d067..9244989118 100644 --- a/arch/arm/mach-imx/include/mach/usb.h +++ b/arch/arm/mach-imx/include/mach/usb.h @@ -11,4 +11,7 @@ #define MX35_H1_USBTE_BIT (1 << 4) #define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0) +int imx6_usb_phy1_disable_oc(void); +int imx6_usb_phy1_enable(void); + #endif /* __MACH_USB_H_*/ diff --git a/arch/arm/mach-imx/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c index 680d26088f..5d7a2449a2 100644 --- a/arch/arm/mach-imx/iomux-v3.c +++ b/arch/arm/mach-imx/iomux-v3.c @@ -37,6 +37,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 c64f23ceb5..db878fb5c7 100644 --- a/arch/arm/mach-mxs/imx.c +++ b/arch/arm/mach-mxs/imx.c @@ -20,6 +20,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 e3855981fd..aecd9e0f52 100644 --- a/arch/arm/mach-nomadik/8815.c +++ b/arch/arm/mach-nomadik/8815.c @@ -25,6 +25,7 @@ #include <mach/hardware.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <linux/amba/bus.h> #include "clock.h" @@ -32,12 +33,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), }; @@ -53,7 +57,6 @@ postcore_initcall(st8815_clkdev_init); void st8815_register_uart(unsigned id) { resource_size_t start; - struct device_d *dev; switch (id) { case 0: @@ -63,7 +66,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/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-versatile/core.c b/arch/arm/mach-versatile/core.c index bdf48f97a2..86cc755788 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -34,6 +34,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> @@ -51,6 +52,8 @@ struct clk { unsigned long rate; }; +static struct clk ref_clk_dummy; + static struct clk ref_clk_24 = { .rate = 24000000, }; @@ -145,6 +148,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), @@ -179,8 +183,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/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 16ba38e50d..87c48ed693 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -568,7 +568,6 @@ do { \ unsigned long long __val; \ unsigned long __flags; \ \ - local_irq_save(__flags); \ if (sel == 0) \ __asm__ __volatile__( \ ".set\tmips64\n\t" \ @@ -587,7 +586,6 @@ do { \ "dsra\t%L0, %L0, 32\n\t" \ ".set\tmips0" \ : "=r" (__val)); \ - local_irq_restore(__flags); \ \ __val; \ }) @@ -596,7 +594,6 @@ do { \ do { \ unsigned long __flags; \ \ - local_irq_save(__flags); \ if (sel == 0) \ __asm__ __volatile__( \ ".set\tmips64\n\t" \ @@ -617,7 +614,6 @@ do { \ "dmtc0\t%L0, " #source ", " #sel "\n\t" \ ".set\tmips0" \ : : "r" (val)); \ - local_irq_restore(__flags); \ } while (0) #define read_c0_index() __read_32bit_c0_register($0, 0) 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/ppc/boards/pcm030/pcm030.c b/arch/ppc/boards/pcm030/pcm030.c index ba6aa43182..89083e91d8 100644 --- a/arch/ppc/boards/pcm030/pcm030.c +++ b/arch/ppc/boards/pcm030/pcm030.c @@ -30,8 +30,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> @@ -39,7 +38,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/ppc/mach-mpc85xx/eth-devices.c b/arch/ppc/mach-mpc85xx/eth-devices.c index 02a3722136..c6e8f3660d 100644 --- a/arch/ppc/mach-mpc85xx/eth-devices.c +++ b/arch/ppc/mach-mpc85xx/eth-devices.c @@ -32,15 +32,15 @@ int fsl_eth_init(int num, struct gfar_info_struct *gf) res = xzalloc(3 * sizeof(struct resource)); /* TSEC interface registers */ res[0].start = GFAR_BASE_ADDR + ((num - 1) * 0x1000); - res[0].end = res[0].start + 0x1000; + res[0].end = res[0].start + 0x1000 - 1; res[0].flags = IORESOURCE_MEM; /* External PHY access always through eTSEC1 */ res[1].start = MDIO_BASE_ADDR; - res[1].end = res[1].start + 0x1000; + res[1].end = res[1].start + 0x1000 - 1; res[1].flags = IORESOURCE_MEM; /* Access to TBI/RTBI interface. */ res[2].start = MDIO_BASE_ADDR + ((num - 1) * 0x1000); - res[2].end = res[2].start + 0x1000; + res[2].end = res[2].start + 0x1000 - 1; res[2].flags = IORESOURCE_MEM; add_generic_device_res("gfar", DEVICE_ID_DYNAMIC, res, 3, gf); 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 2959e85c7a..e762521b7a 100644 --- a/arch/sandbox/board/console.c +++ b/arch/sandbox/board/console.c @@ -47,6 +47,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 96fa100011..00e46e22d4 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -102,7 +102,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 e296574c93..38c6596195 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -355,10 +355,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); @@ -366,14 +362,8 @@ int main(int argc, char *argv[]) exit(1); fdno++; break; - case 'e': - break; - case 'O': - break; - case 'I': - break; default: - exit(1); + break; } } |