diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-09 03:58:49 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-09 03:58:49 +0200 |
commit | 597da1b76ebd0083f929e59801f72a6dd6aef5cd (patch) | |
tree | 533372bf174baae1b81bccae1b6ba300a518d642 /arch | |
parent | 0e7c77a3fdfa0504c31594dd800e460820a5fff1 (diff) | |
parent | 502ecda2d17ed4b50b6c4d5afb04832013996173 (diff) | |
download | barebox-597da1b76ebd0083f929e59801f72a6dd6aef5cd.tar.gz barebox-597da1b76ebd0083f929e59801f72a6dd6aef5cd.tar.xz |
Merge branch 'next'
Diffstat (limited to 'arch')
178 files changed, 1314 insertions, 648 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f1c045e04f..d25412d11f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -105,6 +105,9 @@ board-$(CONFIG_MACH_FREESCALE_MX51_PDK) := freescale-mx51-pdk board-$(CONFIG_MACH_FREESCALE_MX53_LOCO) := freescale-mx53-loco board-$(CONFIG_MACH_GUF_CUPID) := guf-cupid board-$(CONFIG_MACH_MINI2440) := mini2440 +board-$(CONFIG_MACH_USB_A9260) := usb-a926x +board-$(CONFIG_MACH_USB_A9263) := usb-a926x +board-$(CONFIG_MACH_USB_A9G20) := usb-a926x board-$(CONFIG_MACH_VERSATILEPB) := versatile board-$(CONFIG_MACH_TX25) := karo-tx25 diff --git a/arch/arm/boards/a9m2410/a9m2410.c b/arch/arm/boards/a9m2410/a9m2410.c index 44ac44bcbc..bbe16044ef 100644 --- a/arch/arm/boards/a9m2410/a9m2410.c +++ b/arch/arm/boards/a9m2410/a9m2410.c @@ -31,7 +31,7 @@ #include <generated/mach-types.h> #include <partition.h> #include <nand.h> -#include <asm/io.h> +#include <io.h> #include <mach/s3c24x0-iomap.h> #include <mach/s3c24x0-nand.h> diff --git a/arch/arm/boards/a9m2440/a9m2410dev.c b/arch/arm/boards/a9m2440/a9m2410dev.c index 1220bd9777..5f7c53b9f6 100644 --- a/arch/arm/boards/a9m2440/a9m2410dev.c +++ b/arch/arm/boards/a9m2440/a9m2410dev.c @@ -27,7 +27,7 @@ #include <common.h> #include <driver.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/s3c24x0-iomap.h> /** diff --git a/arch/arm/boards/a9m2440/a9m2440.c b/arch/arm/boards/a9m2440/a9m2440.c index 89c9cdf57e..964d376412 100644 --- a/arch/arm/boards/a9m2440/a9m2440.c +++ b/arch/arm/boards/a9m2440/a9m2440.c @@ -31,7 +31,7 @@ #include <generated/mach-types.h> #include <partition.h> #include <nand.h> -#include <asm/io.h> +#include <io.h> #include <mach/s3c24x0-iomap.h> #include <mach/s3c24x0-nand.h> #include <mach/s3c24xx-generic.h> diff --git a/arch/arm/boards/at91rm9200ek/init.c b/arch/arm/boards/at91rm9200ek/init.c index cff7ede4d3..b2008a4394 100644 --- a/arch/arm/boards/at91rm9200ek/init.c +++ b/arch/arm/boards/at91rm9200ek/init.c @@ -27,7 +27,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <mach/at91_pmc.h> #include <mach/board.h> diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c index 861e8980a5..ea80a1b039 100644 --- a/arch/arm/boards/at91sam9260ek/init.c +++ b/arch/arm/boards/at91sam9260ek/init.c @@ -28,7 +28,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> @@ -63,8 +63,6 @@ static struct atmel_nand_data nand_pdata = { .ale = 21, .cle = 22, /* .det_pin = ... not connected */ - .ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC), - .ecc_mode = NAND_ECC_HW, .rdy_pin = AT91_PIN_PC13, .enable_pin = AT91_PIN_PC14, #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c index 73b411add0..0bef84d132 100644 --- a/arch/arm/boards/at91sam9261ek/init.c +++ b/arch/arm/boards/at91sam9261ek/init.c @@ -27,7 +27,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> @@ -43,7 +43,6 @@ static struct atmel_nand_data nand_pdata = { .ale = 22, .cle = 21, /* .det_pin = ... not connected */ - .ecc_mode = NAND_ECC_SOFT, .rdy_pin = AT91_PIN_PC15, .enable_pin = AT91_PIN_PC14, #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c index 46f3a7ede2..40c0b7b6f2 100644 --- a/arch/arm/boards/at91sam9263ek/init.c +++ b/arch/arm/boards/at91sam9263ek/init.c @@ -29,7 +29,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> @@ -44,8 +44,6 @@ static struct atmel_nand_data nand_pdata = { .ale = 21, .cle = 22, /* .det_pin = ... not connected */ - .ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC0), - .ecc_mode = NAND_ECC_HW, .rdy_pin = AT91_PIN_PA22, .enable_pin = AT91_PIN_PD15, #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c index ba7c2fff48..073ff42374 100644 --- a/arch/arm/boards/at91sam9m10g45ek/init.c +++ b/arch/arm/boards/at91sam9m10g45ek/init.c @@ -30,7 +30,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> diff --git a/arch/arm/boards/chumby_falconwing/falconwing.c b/arch/arm/boards/chumby_falconwing/falconwing.c index 1c66eb231a..38f28be9c5 100644 --- a/arch/arm/boards/chumby_falconwing/falconwing.c +++ b/arch/arm/boards/chumby_falconwing/falconwing.c @@ -25,7 +25,7 @@ #include <sizes.h> #include <usb/ehci.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <generated/mach-types.h> #include <mach/imx-regs.h> diff --git a/arch/arm/boards/edb93xx/edb93xx.c b/arch/arm/boards/edb93xx/edb93xx.c index 3e4e0b04a0..70fd12c1bf 100644 --- a/arch/arm/boards/edb93xx/edb93xx.c +++ b/arch/arm/boards/edb93xx/edb93xx.c @@ -27,7 +27,7 @@ #include <init.h> #include <partition.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <generated/mach-types.h> #include <mach/ep93xx-regs.h> #include "edb93xx.h" diff --git a/arch/arm/boards/edb93xx/flash_cfg.c b/arch/arm/boards/edb93xx/flash_cfg.c index 91a6a4ea96..56bf0b57c2 100644 --- a/arch/arm/boards/edb93xx/flash_cfg.c +++ b/arch/arm/boards/edb93xx/flash_cfg.c @@ -24,7 +24,7 @@ #include <common.h> #include <mach/ep93xx-regs.h> -#include <asm/io.h> +#include <io.h> #define SMC_BCR6_VALUE (2 << SMC_BCR_IDCY_SHIFT | 5 << SMC_BCR_WST1_SHIFT | \ SMC_BCR_BLE | 2 << SMC_BCR_WST2_SHIFT | \ diff --git a/arch/arm/boards/edb93xx/pll_cfg.c b/arch/arm/boards/edb93xx/pll_cfg.c index a687af0a01..a53efa69c1 100644 --- a/arch/arm/boards/edb93xx/pll_cfg.c +++ b/arch/arm/boards/edb93xx/pll_cfg.c @@ -25,7 +25,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include "pll_cfg.h" #include "early_udelay.h" diff --git a/arch/arm/boards/edb93xx/sdram_cfg.c b/arch/arm/boards/edb93xx/sdram_cfg.c index 3d4fe08e19..8342d446b3 100644 --- a/arch/arm/boards/edb93xx/sdram_cfg.c +++ b/arch/arm/boards/edb93xx/sdram_cfg.c @@ -23,7 +23,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include "sdram_cfg.h" #include "early_udelay.h" diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c index 1c54202dfa..6355e3c205 100644 --- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c +++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c @@ -29,7 +29,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <led.h> diff --git a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c index 4ebf247776..12219737c0 100644 --- a/arch/arm/boards/eukrea_cpuimx25/lowlevel.c +++ b/arch/arm/boards/eukrea_cpuimx25/lowlevel.c @@ -26,7 +26,7 @@ #include <mach/imx-regs.h> #include <mach/imx-pll.h> #include <mach/esdctl.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm-generic/memory_layout.h> diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c index a5aadac0d9..994f45629b 100644 --- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c +++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c @@ -37,7 +37,7 @@ #include <fcntl.h> #include <nand.h> #include <command.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <mach/imx-pll.h> #include <mach/imxfb.h> diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c index 426445f59d..5f654d47c1 100644 --- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c +++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c @@ -39,7 +39,7 @@ #include <partition.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <generated/mach-types.h> #include <asm/mmu.h> diff --git a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c index 6c0e106f67..a909a8784e 100644 --- a/arch/arm/boards/eukrea_cpuimx35/lowlevel.c +++ b/arch/arm/boards/eukrea_cpuimx35/lowlevel.c @@ -26,7 +26,7 @@ #include <mach/imx-pll.h> #include <mach/esdctl.h> #include <asm/cache-l2x0.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm-generic/memory_layout.h> diff --git a/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c b/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c index 727db29241..a128d500ad 100644 --- a/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c +++ b/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c @@ -34,7 +34,7 @@ #include <nand.h> #include <spi/spi.h> #include <mfd/mc13892.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <mach/imx-nand.h> #include <mach/spi.h> diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c index 979115d927..5aa54e43ff 100644 --- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c +++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c @@ -28,7 +28,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <partition.h> #include <generated/mach-types.h> #include <mach/imx-nand.h> diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c index ab702650ab..030a1a7acf 100644 --- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c +++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c @@ -37,7 +37,7 @@ #include <partition.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <generated/mach-types.h> #include <mach/gpio.h> diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c index 646f807c7a..d56effaaf9 100644 --- a/arch/arm/boards/freescale-mx51-pdk/board.c +++ b/arch/arm/boards/freescale-mx51-pdk/board.c @@ -32,7 +32,7 @@ #include <nand.h> #include <spi/spi.h> #include <mfd/mc13892.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <mach/imx-nand.h> #include <mach/spi.h> diff --git a/arch/arm/boards/freescale-mx53-loco/board.c b/arch/arm/boards/freescale-mx53-loco/board.c index b5240f4f3a..24df9ae0b0 100644 --- a/arch/arm/boards/freescale-mx53-loco/board.c +++ b/arch/arm/boards/freescale-mx53-loco/board.c @@ -36,7 +36,7 @@ #include <mach/iim.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> static struct fec_platform_data fec_info = { diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c index 706707d0bb..158adfcda4 100644 --- a/arch/arm/boards/guf-cupid/board.c +++ b/arch/arm/boards/guf-cupid/board.c @@ -32,7 +32,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <partition.h> #include <nand.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/guf-cupid/lowlevel.c b/arch/arm/boards/guf-cupid/lowlevel.c index 8d403ee821..396604d59f 100644 --- a/arch/arm/boards/guf-cupid/lowlevel.c +++ b/arch/arm/boards/guf-cupid/lowlevel.c @@ -26,7 +26,7 @@ #include <mach/imx-pll.h> #include <mach/esdctl.h> #include <asm/cache-l2x0.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm-generic/memory_layout.h> diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c index 446b333f1f..e524b70aac 100644 --- a/arch/arm/boards/guf-neso/board.c +++ b/arch/arm/boards/guf-neso/board.c @@ -32,7 +32,7 @@ #include <spi/spi.h> #include <usb/isp1504.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <asm/armlinux.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c index d366d440af..b1ad621e06 100644 --- a/arch/arm/boards/guf-neso/lowlevel.c +++ b/arch/arm/boards/guf-neso/lowlevel.c @@ -26,7 +26,7 @@ #include <mach/imx-pll.h> #include <mach/esdctl.h> #include <asm/cache-l2x0.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm/system.h> diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c index d58831e748..fc34709630 100644 --- a/arch/arm/boards/imx21ads/imx21ads.c +++ b/arch/arm/boards/imx21ads/imx21ads.c @@ -27,7 +27,7 @@ #include <environment.h> #include <mach/imx-regs.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <mach/gpio.h> #include <partition.h> #include <fs.h> diff --git a/arch/arm/boards/imx27ads/imx27ads.c b/arch/arm/boards/imx27ads/imx27ads.c index da4260fa58..e93f07a078 100644 --- a/arch/arm/boards/imx27ads/imx27ads.c +++ b/arch/arm/boards/imx27ads/imx27ads.c @@ -24,7 +24,7 @@ #include <environment.h> #include <mach/imx-regs.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <fec.h> #include <mach/gpio.h> #include <partition.h> diff --git a/arch/arm/boards/karo-tx25/board.c b/arch/arm/boards/karo-tx25/board.c index 22bc27a291..1eece1dfed 100644 --- a/arch/arm/boards/karo-tx25/board.c +++ b/arch/arm/boards/karo-tx25/board.c @@ -28,7 +28,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <partition.h> #include <generated/mach-types.h> #include <mach/imx-nand.h> diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c index 868ba08dd7..09c0339659 100644 --- a/arch/arm/boards/karo-tx25/lowlevel.c +++ b/arch/arm/boards/karo-tx25/lowlevel.c @@ -24,7 +24,7 @@ #include <init.h> #include <mach/imx-regs.h> #include <mach/esdctl.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm/system.h> diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c index 8427dc2391..b36d8226e5 100644 --- a/arch/arm/boards/karo-tx28/tx28-stk5.c +++ b/arch/arm/boards/karo-tx28/tx28-stk5.c @@ -20,8 +20,7 @@ #include <mci.h> #include <fec.h> #include <sizes.h> -#include <reloc.h> -#include <asm/io.h> +#include <io.h> #include <asm/sections.h> #include <mach/imx-regs.h> #include <mach/clock.h> diff --git a/arch/arm/boards/karo-tx28/tx28.c b/arch/arm/boards/karo-tx28/tx28.c index def388a8d9..a62cb8257f 100644 --- a/arch/arm/boards/karo-tx28/tx28.c +++ b/arch/arm/boards/karo-tx28/tx28.c @@ -18,7 +18,7 @@ #include <environment.h> #include <errno.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <generated/mach-types.h> #include <mach/imx-regs.h> #include <asm/mmu.h> diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c index fd1f2f27c3..43510238e0 100644 --- a/arch/arm/boards/mini2440/mini2440.c +++ b/arch/arm/boards/mini2440/mini2440.c @@ -36,7 +36,7 @@ #include <mci.h> #include <fb.h> #include <asm/armlinux.h> -#include <asm/io.h> +#include <io.h> #include <mach/gpio.h> #include <mach/s3c24x0-iomap.h> #include <mach/s3c24x0-nand.h> diff --git a/arch/arm/boards/mmccpu/init.c b/arch/arm/boards/mmccpu/init.c index 36bc193bfc..51dbf24621 100644 --- a/arch/arm/boards/mmccpu/init.c +++ b/arch/arm/boards/mmccpu/init.c @@ -28,7 +28,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c index dcf716620d..42d981cbfd 100644 --- a/arch/arm/boards/nhk8815/setup.c +++ b/arch/arm/boards/nhk8815/setup.c @@ -26,7 +26,7 @@ #include <nand.h> #include <asm/armlinux.h> #include <generated/mach-types.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> #include <mach/board.h> diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c index 4e7f179a6f..bfb08f7042 100644 --- a/arch/arm/boards/omap/board-beagle.c +++ b/arch/arm/boards/omap/board-beagle.c @@ -57,7 +57,7 @@ #include <init.h> #include <driver.h> #include <sizes.h> -#include <asm/io.h> +#include <io.h> #include <ns16550.h> #include <asm/armlinux.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/omap/board-omap3evm.c b/arch/arm/boards/omap/board-omap3evm.c index 71d6ca9e40..d2f041ad71 100644 --- a/arch/arm/boards/omap/board-omap3evm.c +++ b/arch/arm/boards/omap/board-omap3evm.c @@ -48,7 +48,7 @@ #include <console.h> #include <init.h> #include <driver.h> -#include <asm/io.h> +#include <io.h> #include <ns16550.h> #include <asm/armlinux.h> #include <mach/silicon.h> diff --git a/arch/arm/boards/omap/board-sdp343x.c b/arch/arm/boards/omap/board-sdp343x.c index 83efe62233..d486c20d74 100644 --- a/arch/arm/boards/omap/board-sdp343x.c +++ b/arch/arm/boards/omap/board-sdp343x.c @@ -51,7 +51,7 @@ #include <console.h> #include <init.h> #include <driver.h> -#include <asm/io.h> +#include <io.h> #include <ns16550.h> #include <asm/armlinux.h> #include <mach/silicon.h> diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c index 33ec144db4..6a149aaeaa 100644 --- a/arch/arm/boards/panda/board.c +++ b/arch/arm/boards/panda/board.c @@ -3,7 +3,7 @@ #include <init.h> #include <fs.h> #include <driver.h> -#include <asm/io.h> +#include <io.h> #include <ns16550.h> #include <asm/armlinux.h> #include <linux/stat.h> diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c index cc0c374a03..45ea221d87 100644 --- a/arch/arm/boards/panda/lowlevel.c +++ b/arch/arm/boards/panda/lowlevel.c @@ -21,7 +21,7 @@ * MA 02111-1307 USA */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-mux.h> #include <mach/omap4-silicon.h> #include <mach/omap4-clock.h> diff --git a/arch/arm/boards/panda/mux.c b/arch/arm/boards/panda/mux.c index a03104011d..7586e86745 100644 --- a/arch/arm/boards/panda/mux.c +++ b/arch/arm/boards/panda/mux.c @@ -1,6 +1,6 @@ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-silicon.h> #include <mach/omap4-mux.h> diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c index 85f004fe48..42a543d2cc 100644 --- a/arch/arm/boards/pcm037/pcm037.c +++ b/arch/arm/boards/pcm037/pcm037.c @@ -32,7 +32,7 @@ #include <mach/iomux-mx31.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #include <partition.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c index b50e1c8386..32392636e7 100644 --- a/arch/arm/boards/pcm038/lowlevel.c +++ b/arch/arm/boards/pcm038/lowlevel.c @@ -25,7 +25,7 @@ #include <mach/imx-regs.h> #include <mach/imx-pll.h> #include <mach/esdctl.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm/system.h> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c index 6fee5c2d61..0b07a6378a 100644 --- a/arch/arm/boards/pcm038/pcm038.c +++ b/arch/arm/boards/pcm038/pcm038.c @@ -35,7 +35,7 @@ #include <nand.h> #include <command.h> #include <spi/spi.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <mach/imx-pll.h> #include <mach/imxfb.h> diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c index e488681c13..40e3204425 100644 --- a/arch/arm/boards/pcm043/lowlevel.c +++ b/arch/arm/boards/pcm043/lowlevel.c @@ -26,7 +26,7 @@ #include <mach/imx-pll.h> #include <mach/esdctl.h> #include <asm/cache-l2x0.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <asm/barebox-arm.h> #include <asm-generic/memory_layout.h> diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c index fbe8cea12f..23580c9f6f 100644 --- a/arch/arm/boards/pcm043/pcm043.c +++ b/arch/arm/boards/pcm043/pcm043.c @@ -32,7 +32,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <partition.h> #include <nand.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c index 3d0277988e..8de333f0d9 100644 --- a/arch/arm/boards/pcm049/board.c +++ b/arch/arm/boards/pcm049/board.c @@ -22,7 +22,7 @@ #include <console.h> #include <init.h> #include <driver.h> -#include <asm/io.h> +#include <io.h> #include <ns16550.h> #include <asm/armlinux.h> #include <generated/mach-types.h> diff --git a/arch/arm/boards/pcm049/lowlevel.c b/arch/arm/boards/pcm049/lowlevel.c index e036ba742d..bea895e31f 100644 --- a/arch/arm/boards/pcm049/lowlevel.c +++ b/arch/arm/boards/pcm049/lowlevel.c @@ -21,7 +21,7 @@ * MA 02111-1307 USA */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-mux.h> #include <mach/omap4-silicon.h> #include <mach/omap4-clock.h> diff --git a/arch/arm/boards/pcm049/mux.c b/arch/arm/boards/pcm049/mux.c index d93d4589eb..9911b62e5a 100644 --- a/arch/arm/boards/pcm049/mux.c +++ b/arch/arm/boards/pcm049/mux.c @@ -1,6 +1,6 @@ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-silicon.h> #include <mach/omap4-mux.h> diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c index f285466641..41567673a7 100644 --- a/arch/arm/boards/phycard-i.MX27/pca100.c +++ b/arch/arm/boards/phycard-i.MX27/pca100.c @@ -32,7 +32,7 @@ #include <fcntl.h> #include <nand.h> #include <spi/spi.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-nand.h> #include <mach/imx-pll.h> #include <gpio.h> diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c index efc5dcc1fb..2766f473d8 100644 --- a/arch/arm/boards/pm9261/init.c +++ b/arch/arm/boards/pm9261/init.c @@ -27,7 +27,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c index aeca4e7d79..92d7e9f166 100644 --- a/arch/arm/boards/pm9263/init.c +++ b/arch/arm/boards/pm9263/init.c @@ -28,7 +28,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> @@ -43,8 +43,6 @@ static struct atmel_nand_data nand_pdata = { .ale = 21, .cle = 22, /* .det_pin = ... not connected */ - .ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC0), - .ecc_mode = NAND_ECC_HW, .rdy_pin = AT91_PIN_PB30, .enable_pin = AT91_PIN_PD15, #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) diff --git a/arch/arm/boards/pm9g45/init.c b/arch/arm/boards/pm9g45/init.c index 35c9ce9f83..480c7513e3 100644 --- a/arch/arm/boards/pm9g45/init.c +++ b/arch/arm/boards/pm9g45/init.c @@ -29,7 +29,7 @@ #include <partition.h> #include <fs.h> #include <fcntl.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware.h> #include <nand.h> #include <linux/mtd/nand.h> diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c index e90417f01e..906a17e07e 100644 --- a/arch/arm/boards/scb9328/scb9328.c +++ b/arch/arm/boards/scb9328/scb9328.c @@ -26,7 +26,7 @@ #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <partition.h> #include <fs.h> #include <fcntl.h> diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile new file mode 100644 index 0000000000..eb072c0161 --- /dev/null +++ b/arch/arm/boards/usb-a926x/Makefile @@ -0,0 +1 @@ +obj-y += init.o diff --git a/arch/arm/boards/usb-a926x/config.h b/arch/arm/boards/usb-a926x/config.h new file mode 100644 index 0000000000..d97181032f --- /dev/null +++ b/arch/arm/boards/usb-a926x/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define AT91_MAIN_CLOCK 12000000 /* 12 MHz crystal */ + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/usb-a926x/env/config b/arch/arm/boards/usb-a926x/env/config new file mode 100644 index 0000000000..d77f6785f5 --- /dev/null +++ b/arch/arm/boards/usb-a926x/env/config @@ -0,0 +1,41 @@ +#!/bin/sh + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=dhcp + +# or set your networking parameters here +#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 'nfs', 'tftp', 'nor' or 'nand' +kernel_loc=tftp +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=net + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root.$rootfs_type + +# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo +#kernelimage_type=zimage +#kernelimage=zImage +kernelimage_type=uimage +kernelimage=uImage +#kernelimage_type=raw +#kernelimage=Image +#kernelimage_type=raw_lzo +#kernelimage=Image.lzo + +nand_device=atmel_nand +nand_parts="128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),4M(kernel),120M(rootfs),-(data)" +rootfs_mtdblock_nand=5 + +autoboot_timeout=3 + +bootargs="console=ttyS0,115200" + +# set a fancy prompt (if support is compiled in) +PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m\n# " diff --git a/arch/arm/boards/usb-a926x/init.c b/arch/arm/boards/usb-a926x/init.c new file mode 100644 index 0000000000..535458226c --- /dev/null +++ b/arch/arm/boards/usb-a926x/init.c @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> + * + * 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 <net.h> +#include <init.h> +#include <environment.h> +#include <asm/armlinux.h> +#include <generated/mach-types.h> +#include <partition.h> +#include <fs.h> +#include <fcntl.h> +#include <io.h> +#include <asm/hardware.h> +#include <nand.h> +#include <sizes.h> +#include <linux/mtd/nand.h> +#include <linux/clk.h> +#include <mach/board.h> +#include <mach/at91sam9_smc.h> +#include <mach/sam9_smc.h> +#include <gpio.h> +#include <mach/io.h> +#include <mach/at91_pmc.h> +#include <mach/at91_rstc.h> + +static void usb_a9260_set_board_type(void) +{ + if (machine_is_usb_a9g20()) + armlinux_set_architecture(MACH_TYPE_USB_A9G20); + else if (machine_is_usb_a9263()) + armlinux_set_architecture(MACH_TYPE_USB_A9263); + else + armlinux_set_architecture(MACH_TYPE_USB_A9260); +} + +static struct atmel_nand_data nand_pdata = { + .ale = 21, + .cle = 22, +/* .det_pin = ... not connected */ + .rdy_pin = AT91_PIN_PC13, + .enable_pin = AT91_PIN_PC14, +}; + +static struct sam9_smc_config usb_a9260_nand_smc_config = { + .ncs_read_setup = 0, + .nrd_setup = 1, + .ncs_write_setup = 0, + .nwe_setup = 1, + + .ncs_read_pulse = 3, + .nrd_pulse = 3, + .ncs_write_pulse = 3, + .nwe_pulse = 3, + + .read_cycle = 5, + .write_cycle = 5, + + .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, + .tdf_cycles = 2, +}; + +static struct sam9_smc_config usb_a9g20_nand_smc_config = { + .ncs_read_setup = 0, + .nrd_setup = 2, + .ncs_write_setup = 0, + .nwe_setup = 2, + + .ncs_read_pulse = 4, + .nrd_pulse = 4, + .ncs_write_pulse = 4, + .nwe_pulse = 2, + + .read_cycle = 7, + .write_cycle = 7, + + .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, + .tdf_cycles = 3, +}; + +static void usb_a9260_add_device_nand(void) +{ + /* configure chip-select 3 (NAND) */ + if (machine_is_usb_a9g20()) + sam9_smc_configure(3, &usb_a9g20_nand_smc_config); + else + sam9_smc_configure(3, &usb_a9260_nand_smc_config); + + if (machine_is_usb_a9263()) { + nand_pdata.rdy_pin = AT91_PIN_PA22; + nand_pdata.enable_pin = AT91_PIN_PD15; + } + + at91_add_device_nand(&nand_pdata); +} + +static struct at91_ether_platform_data macb_pdata = { + .flags = AT91SAM_ETHER_RMII, + .phy_addr = 0, +}; + +static void usb_a9260_phy_reset(void) +{ + unsigned long rstc; + struct clk *clk = clk_get(NULL, "macb_clk"); + + clk_enable(clk); + + at91_set_gpio_input(AT91_PIN_PA14, 0); + at91_set_gpio_input(AT91_PIN_PA15, 0); + at91_set_gpio_input(AT91_PIN_PA17, 0); + at91_set_gpio_input(AT91_PIN_PA25, 0); + at91_set_gpio_input(AT91_PIN_PA26, 0); + at91_set_gpio_input(AT91_PIN_PA28, 0); + + rstc = at91_sys_read(AT91_RSTC_MR) & AT91_RSTC_ERSTL; + + /* Need to reset PHY -> 500ms reset */ + at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | + (AT91_RSTC_ERSTL & (0x0d << 8)) | + AT91_RSTC_URSTEN); + + at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST); + + /* Wait for end hardware reset */ + while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL)); + + /* Restore NRST value */ + at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | + (rstc) | + AT91_RSTC_URSTEN); +} + +#if defined(CONFIG_MCI_ATMEL) +static struct atmel_mci_platform_data __initdata usb_a9260_mci_data = { + .bus_width = 4, +}; + +static void usb_a9260_add_device_mci(void) +{ + at91_add_device_mci(0, &usb_a9260_mci_data); +} +#else +static void usb_a9260_add_device_mci(void) {} +#endif + +static struct at91_usbh_data ek_usbh_data = { + .ports = 2, +}; + +static int usb_a9260_devices_init(void) +{ + usb_a9260_add_device_nand(); + usb_a9260_phy_reset(); + at91_add_device_eth(&macb_pdata); + usb_a9260_add_device_mci(); + at91_add_device_usbh_ohci(&ek_usbh_data); + +#ifdef CONFIG_AT91_HAVE_SRAM_128M + at91_add_device_sdram(128 * 1024 * 1024); +#else + at91_add_device_sdram(64 * 1024 * 1024); +#endif + armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100)); + usb_a9260_set_board_type(); + + devfs_add_partition("nand0", 0x00000, SZ_128K, PARTITION_FIXED, "at91bootstrap_raw"); + dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap"); + devfs_add_partition("nand0", SZ_128K, SZ_256K, PARTITION_FIXED, "self_raw"); + dev_add_bb_dev("self_raw", "self0"); + devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, PARTITION_FIXED, "env_raw"); + dev_add_bb_dev("env_raw", "env0"); + devfs_add_partition("nand0", SZ_512K, SZ_128K, PARTITION_FIXED, "env_raw1"); + dev_add_bb_dev("env_raw1", "env1"); + + return 0; +} +device_initcall(usb_a9260_devices_init); + +static int usb_a9260_console_init(void) +{ + at91_register_uart(0, 0); + return 0; +} +console_initcall(usb_a9260_console_init); diff --git a/arch/arm/configs/at91sam9260ek_defconfig b/arch/arm/configs/at91sam9260ek_defconfig index 6038aec3fe..2d04206cfa 100644 --- a/arch/arm/configs/at91sam9260ek_defconfig +++ b/arch/arm/configs/at91sam9260ek_defconfig @@ -1,3 +1,4 @@ +CONFIG_ARCH_AT91SAM9260=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_LONGHELP=y CONFIG_GLOB=y diff --git a/arch/arm/configs/usb_a9260_defconfig b/arch/arm/configs/usb_a9260_defconfig new file mode 100644 index 0000000000..adcb6036f5 --- /dev/null +++ b/arch/arm/configs/usb_a9260_defconfig @@ -0,0 +1,58 @@ +CONFIG_ARCH_AT91SAM9260=y +CONFIG_MACH_USB_A9260=y +CONFIG_AEABI=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_MMU=y +CONFIG_KALLSYMS=y +CONFIG_PROMPT="USB-9G20:" +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="y" +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_PARTITION=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_ZLIB=y +CONFIG_CMD_BOOTM_BZLIB=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_GPIO=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_DRIVER_NET_MACB=y +# CONFIG_SPI is not set +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_ATMEL=y +CONFIG_UBI=y diff --git a/arch/arm/configs/usb_a9263_128mib_defconfig b/arch/arm/configs/usb_a9263_128mib_defconfig new file mode 100644 index 0000000000..8d5342e38c --- /dev/null +++ b/arch/arm/configs/usb_a9263_128mib_defconfig @@ -0,0 +1,59 @@ +CONFIG_ARCH_AT91SAM9263=y +CONFIG_MACH_USB_A9263=y +CONFIG_AEABI=y +CONFIG_AT91_HAVE_SRAM_128M=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_MMU=y +CONFIG_KALLSYMS=y +CONFIG_PROMPT="USB-9G20:" +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="y" +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_PARTITION=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_ZLIB=y +CONFIG_CMD_BOOTM_BZLIB=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_GPIO=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_DRIVER_NET_MACB=y +# CONFIG_SPI is not set +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_ATMEL=y +CONFIG_UBI=y diff --git a/arch/arm/configs/usb_a9263_defconfig b/arch/arm/configs/usb_a9263_defconfig new file mode 100644 index 0000000000..9f53431b93 --- /dev/null +++ b/arch/arm/configs/usb_a9263_defconfig @@ -0,0 +1,58 @@ +CONFIG_ARCH_AT91SAM9263=y +CONFIG_MACH_USB_A9263=y +CONFIG_AEABI=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_MMU=y +CONFIG_KALLSYMS=y +CONFIG_PROMPT="USB-9G20:" +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="y" +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_PARTITION=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_ZLIB=y +CONFIG_CMD_BOOTM_BZLIB=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_GPIO=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_DRIVER_NET_MACB=y +# CONFIG_SPI is not set +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_ATMEL=y +CONFIG_UBI=y diff --git a/arch/arm/configs/usb_a9g20_128mib_defconfig b/arch/arm/configs/usb_a9g20_128mib_defconfig new file mode 100644 index 0000000000..3c0e6f72a3 --- /dev/null +++ b/arch/arm/configs/usb_a9g20_128mib_defconfig @@ -0,0 +1,59 @@ +CONFIG_ARCH_AT91SAM9G20=y +CONFIG_MACH_USB_A9G20=y +CONFIG_AEABI=y +CONFIG_AT91_HAVE_SRAM_128M=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_MMU=y +CONFIG_KALLSYMS=y +CONFIG_PROMPT="USB-9G20:" +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="y" +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_PARTITION=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_ZLIB=y +CONFIG_CMD_BOOTM_BZLIB=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_GPIO=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_DRIVER_NET_MACB=y +# CONFIG_SPI is not set +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_ATMEL=y +CONFIG_UBI=y diff --git a/arch/arm/configs/usb_a9g20_defconfig b/arch/arm/configs/usb_a9g20_defconfig new file mode 100644 index 0000000000..2bcb8eb797 --- /dev/null +++ b/arch/arm/configs/usb_a9g20_defconfig @@ -0,0 +1,58 @@ +CONFIG_ARCH_AT91SAM9G20=y +CONFIG_MACH_USB_A9G20=y +CONFIG_AEABI=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_MMU=y +CONFIG_KALLSYMS=y +CONFIG_PROMPT="USB-9G20:" +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="y" +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_PARTITION=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_MTEST=y +CONFIG_CMD_MTEST_ALTERNATIVE=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_BOOTM_ZLIB=y +CONFIG_CMD_BOOTM_BZLIB=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_GPIO=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_DRIVER_NET_MACB=y +# CONFIG_SPI is not set +CONFIG_MTD=y +CONFIG_NAND=y +CONFIG_NAND_ATMEL=y +CONFIG_UBI=y diff --git a/arch/arm/cpu/cache-l2x0.c b/arch/arm/cpu/cache-l2x0.c index 1ea7bab362..b300e6ffb0 100644 --- a/arch/arm/cpu/cache-l2x0.c +++ b/arch/arm/cpu/cache-l2x0.c @@ -1,6 +1,6 @@ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <asm/mmu.h> #define CACHE_LINE_SIZE 32 diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c index 3df0c0f647..d4a3b14819 100644 --- a/arch/arm/cpu/cpu.c +++ b/arch/arm/cpu/cpu.c @@ -90,19 +90,6 @@ void arch_shutdown(void) #endif } -LIST_HEAD(memory_list); - -void armlinux_add_dram(struct device_d *dev) -{ - struct arm_memory *mem = xzalloc(sizeof(*mem)); - - mem->dev = dev; - mem->start = dev->resource[0].start; - mem->size = dev->resource[0].size; - - list_add_tail(&mem->list, &memory_list); -} - /** * @page arm_boot_preparation Linux Preparation on ARM * diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index b6693495b6..4446813d0a 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -5,6 +5,7 @@ #include <sizes.h> #include <asm/memory.h> #include <asm/system.h> +#include <memory.h> static unsigned long *ttb; @@ -76,28 +77,28 @@ static u32 *arm_create_pte(unsigned long virt) return table; } +static u32 *find_pte(unsigned long adr) +{ + u32 *table; + + if ((ttb[adr >> 20] & PMD_TYPE_MASK) != PMD_TYPE_TABLE) + BUG(); + + /* find the coarse page table base address */ + table = (u32 *)(ttb[adr >> 20] & ~0x3ff); + + /* find second level descriptor */ + return &table[(adr >> PAGE_SHIFT) & 0xff]; +} + static void remap_range(void *_start, size_t size, uint32_t flags) { - u32 pteentry; - struct arm_memory *mem; unsigned long start = (unsigned long)_start; u32 *p; int numentries, i; - for_each_sdram_bank(mem) { - if (start >= mem->start && start < mem->start + mem->size) - goto found; - } - - BUG(); - return; - -found: - pteentry = (start - mem->start) >> PAGE_SHIFT; - numentries = size >> PAGE_SHIFT; - - p = mem->ptes + pteentry; + p = find_pte(start); for (i = 0; i < numentries; i++) { p[i] &= ~PTE_MASK; @@ -114,38 +115,39 @@ found: * remap the memory bank described by mem cachable and * bufferable */ -static int arm_mmu_remap_sdram(struct arm_memory *mem) +static int arm_mmu_remap_sdram(struct memory_bank *bank) { - unsigned long phys = (unsigned long)mem->start; + unsigned long phys = (unsigned long)bank->start; unsigned long ttb_start = phys >> 20; - unsigned long ttb_end = (phys + mem->size) >> 20; - unsigned long num_ptes = mem->size >> 10; + unsigned long ttb_end = (phys + bank->size) >> 20; + unsigned long num_ptes = bank->size >> 10; int i, pte; + u32 *ptes; debug("remapping SDRAM from 0x%08lx (size 0x%08lx)\n", - phys, mem->size); + phys, bank->size); /* * We replace each 1MiB section in this range with second level page * tables, therefore we must have 1Mib aligment here. */ - if ((phys & (SZ_1M - 1)) || (mem->size & (SZ_1M - 1))) + if ((phys & (SZ_1M - 1)) || (bank->size & (SZ_1M - 1))) return -EINVAL; - mem->ptes = memalign(0x400, num_ptes * sizeof(u32)); + ptes = memalign(0x400, num_ptes * sizeof(u32)); debug("ptes: 0x%p ttb_start: 0x%08lx ttb_end: 0x%08lx\n", - mem->ptes, ttb_start, ttb_end); + ptes, ttb_start, ttb_end); for (i = 0; i < num_ptes; i++) { - mem->ptes[i] = (phys + i * 4096) | PTE_TYPE_SMALL | + ptes[i] = (phys + i * 4096) | PTE_TYPE_SMALL | PTE_FLAGS_CACHED; } pte = 0; for (i = ttb_start; i < ttb_end; i++) { - ttb[i] = (unsigned long)(&mem->ptes[pte]) | PMD_TYPE_TABLE | + ttb[i] = (unsigned long)(&ptes[pte]) | PMD_TYPE_TABLE | (0 << 4); pte += 256; } @@ -209,7 +211,7 @@ static void vectors_init(void) */ static int mmu_init(void) { - struct arm_memory *mem; + struct memory_bank *bank; int i; ttb = memalign(0x10000, 0x4000); @@ -234,8 +236,8 @@ static int mmu_init(void) * This is to speed up the generation of 2nd level page tables * below */ - for_each_sdram_bank(mem) - create_section(mem->start, mem->start, mem->size >> 20, + for_each_memory_bank(bank) + create_section(bank->start, bank->start, bank->size >> 20, PMD_SECT_DEF_CACHED); asm volatile ( @@ -249,8 +251,8 @@ static int mmu_init(void) * Now that we have the MMU and caches on remap sdram again using * page tables */ - for_each_sdram_bank(mem) - arm_mmu_remap_sdram(mem); + for_each_memory_bank(bank) + arm_mmu_remap_sdram(bank); return 0; } diff --git a/arch/arm/include/asm/armlinux.h b/arch/arm/include/asm/armlinux.h index bb25f9a87d..ba3a424e26 100644 --- a/arch/arm/include/asm/armlinux.h +++ b/arch/arm/include/asm/armlinux.h @@ -31,7 +31,4 @@ struct image_data; void start_linux(void *adr, int swap, struct image_data *data); -struct device_d *arm_add_mem_device(const char* name, resource_size_t start, - resource_size_t size); - #endif /* __ARCH_ARMLINUX_H */ diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index e8e82f6f8b..ab78be3848 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -1,53 +1,6 @@ -/* - * linux/include/asm-arm/io.h - * - * Copyright (C) 1996-2000 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Modifications: - * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both - * constant addresses and variable addresses. - * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture - * specific IO header files. - * 27-Mar-1999 PJB Second parameter of memcpy_toio is const.. - * 04-Apr-1999 PJB Added check_signature. - * 12-Dec-1999 RMK More cleanups - * 18-Jun-2000 RMK Removed virt_to_* and friends definitions - */ - -/** - * @file - * @brief ARM IO access functions - */ - #ifndef __ASM_ARM_IO_H #define __ASM_ARM_IO_H -#define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v)) -#define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v)) -#define __raw_writel(v,a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v)) - -#define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) -#define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) -#define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) - -#define writeb(v,a) __raw_writeb(v,a) -#define writew(v,a) __raw_writew(v,a) -#define writel(v,a) __raw_writel(v,a) - -#define readb(a) __raw_readb(a) -#define readw(a) __raw_readw(a) -#define readl(a) __raw_readl(a) - -/* for the ARM architecture the string functions are library based */ -extern void writesb(void __iomem*, const void*, int); -extern void writesw(void __iomem*, const void*, int); -extern void writesl(void __iomem*, const void*, int); -extern void readsb(const void __iomem*, void*, int); -extern void readsw(const void __iomem*, void*, int); -extern void readsl(const void __iomem*, void*, int); +#include <asm-generic/io.h> #endif /* __ASM_ARM_IO_H */ diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 93c2fe6007..28afaa39e4 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -1,18 +1,12 @@ #ifndef __ASM_ARM_MEMORY_H #define __ASM_ARM_MEMORY_H -struct arm_memory { - struct list_head list; - struct device_d *dev; - u32 *ptes; - unsigned long start; - unsigned long size; -}; +#include <memory.h> -extern struct list_head memory_list; - -void armlinux_add_dram(struct device_d *dev); - -#define for_each_sdram_bank(mem) list_for_each_entry(mem, &memory_list, list) +static inline void arm_add_mem_device(const char* name, resource_size_t start, + resource_size_t size) +{ + barebox_add_memory_bank(name, start, size); +} #endif /* __ASM_ARM_MEMORY_H */ diff --git a/arch/arm/lib/arm.c b/arch/arm/lib/arm.c index 6549118b83..c85aae14a0 100644 --- a/arch/arm/lib/arm.c +++ b/arch/arm/lib/arm.c @@ -1,6 +1,6 @@ #include <common.h> #include <init.h> -#include <mem_malloc.h> +#include <memory.h> #include <asm/barebox-arm.h> #include <asm-generic/memory_layout.h> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c index 5bdbb92bff..e3a74f4ffb 100644 --- a/arch/arm/lib/armlinux.c +++ b/arch/arm/lib/armlinux.c @@ -35,13 +35,13 @@ #include <malloc.h> #include <fcntl.h> #include <errno.h> +#include <memory.h> #include <asm/byteorder.h> #include <asm/setup.h> #include <asm/barebox-arm.h> #include <asm/armlinux.h> #include <asm/system.h> -#include <asm/memory.h> static struct tag *params; static int armlinux_architecture = 0; @@ -66,14 +66,14 @@ static void setup_start_tag(void) static void setup_memory_tags(void) { - struct arm_memory *mem; + struct memory_bank *bank; - for_each_sdram_bank(mem) { + for_each_memory_bank(bank) { params->hdr.tag = ATAG_MEM; params->hdr.size = tag_size(tag_mem32); - params->u.mem.start = mem->dev->resource[0].start; - params->u.mem.size = mem->dev->resource[0].size; + params->u.mem.start = bank->start; + params->u.mem.size = bank->size; params = tag_next(params); } @@ -186,7 +186,14 @@ void armlinux_set_bootparams(void *params) void armlinux_set_architecture(int architecture) { + char *arch_number = asprintf("%d", architecture); + armlinux_architecture = architecture; + + setenv("arch_number", arch_number); + export("arch_number"); + + kfree(arch_number); } void armlinux_set_revision(unsigned int rev) diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c index 13bed25aeb..fc14487bfa 100644 --- a/arch/arm/lib/bootz.c +++ b/arch/arm/lib/bootz.c @@ -9,6 +9,7 @@ #include <asm/armlinux.h> #include <asm/system.h> #include <asm-generic/memory_layout.h> +#include <memory.h> struct zimage_header { u32 unused[9]; @@ -26,7 +27,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) void *zimage; u32 end; int usemap = 0; - struct arm_memory *mem = list_first_entry(&memory_list, struct arm_memory, list); + struct memory_bank *bank = list_first_entry(&memory_banks, struct memory_bank, list); if (argc != 2) { barebox_cmd_usage(cmdtp); @@ -44,8 +45,8 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) * the first 128MB of SDRAM. */ zimage = memmap(fd, PROT_READ); - if (zimage && (unsigned long)zimage >= mem->start && - (unsigned long)zimage < mem->start + SZ_128M) { + if (zimage && (unsigned long)zimage >= bank->start && + (unsigned long)zimage < bank->start + SZ_128M) { usemap = 1; header = zimage; } @@ -78,11 +79,11 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) end = swab32(end); if (!usemap) { - if (mem->size <= SZ_128M) { + if (bank->size <= SZ_128M) { zimage = xmalloc(end); } else { - zimage = (void *)mem->start + SZ_8M; - if (mem->start + SZ_8M + end >= MALLOC_BASE) { + zimage = (void *)bank->start + SZ_8M; + if (bank->start + SZ_8M + end >= MALLOC_BASE) { printf("won't overwrite malloc space with image\n"); goto err_out1; } diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index ee46002819..2ac23b5f19 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -14,6 +14,9 @@ config BOARDINFO default "Atmel at91sam9g20-ek" if MACH_AT91SAM9G20EK default "Atmel at91sam9m10g45-ek" if MACH_AT91SAM9M10G45EK default "Bucyrus MMC-CPU" if MACH_MMCCPU + default "Calao USB-A9260" if MACH_USB_A9260 + default "Calao USB-A9263" if MACH_USB_A9263 + default "Calao USB-A9G20" if MACH_USB_A9G20 default "Ronetix PM9261" if MACH_PM9261 default "Ronetix PM9263" if MACH_PM9263 default "Ronetix PM9G45" if MACH_PM9G45 @@ -96,6 +99,12 @@ config MACH_AT91SAM9260EK help Say y here if you are using Atmel's AT91SAM9260-EK Evaluation board +config MACH_USB_A9260 + bool "CALAO USB-A9260" + help + Select this if you are using a Calao Systems USB-A9260. + <http://www.calao-systems.com> + endchoice endif @@ -160,6 +169,12 @@ config MACH_AT91SAM9G20EK Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit that embeds only one SD/MMC slot. +config MACH_USB_A9G20 + bool "CALAO USB-A9G20" + help + Select this if you are using a Calao Systems USB-A9G20. + <http://www.calao-systems.com> + endchoice endif @@ -189,6 +204,12 @@ config MACH_PM9263 help Say y here if you are using the Ronetix PM9263 Board +config MACH_USB_A9263 + bool "CALAO USB-A9263" + help + Select this if you are using a Calao Systems USB-A9263. + <http://www.calao-systems.com> + endchoice endif @@ -234,6 +255,12 @@ config AT91_HAVE_2MMC with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and onwards. +config AT91_HAVE_SRAM_128M + bool "Have 128 of ram" + depends on MACH_USB_A9G20 || MACH_USB_A9263 + help + Select this if you board have 128 MiB of Ram (as USB_A9G20 C11) + choice prompt "LCD type" depends on MACH_AT91SAM9M10G45EK diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 453c10a5de..bd7d3f05e4 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -26,6 +26,24 @@ void at91_add_device_sdram(u32 size) } /* -------------------------------------------------------------------- + * USB Host + * -------------------------------------------------------------------- */ + +#if defined(CONFIG_USB_OHCI) +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) +{ + if (!data) + return; + + add_generic_device("at91_ohci", -1, NULL, AT91RM9200_UHP_BASE, 1024 * 1024, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} +#endif + + +/* -------------------------------------------------------------------- * Ethernet * -------------------------------------------------------------------- */ diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 92b9e663a4..b6e7f552e1 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c @@ -37,7 +37,7 @@ #include <mach/at91_st.h> #include <mach/at91_pmc.h> #include <mach/io.h> -#include <asm/io.h> +#include <io.h> /* * The ST_CRTR is updated asynchronously to the master clock ... but diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 44d3f1e989..9d1acda7fe 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c @@ -26,6 +26,19 @@ void at91_add_device_sdram(u32 size) arm_add_mem_device("ram0", AT91_CHIPSELECT_1, size); } +#if defined(CONFIG_USB_OHCI) +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) +{ + if (!data) + return; + + add_generic_device("at91_ohci", -1, NULL, AT91SAM9260_UHP_BASE, 1024 * 1024, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} +#endif + #if defined(CONFIG_DRIVER_NET_MACB) void at91_add_device_eth(struct at91_ether_platform_data *data) { @@ -63,6 +76,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {} #endif #if defined(CONFIG_NAND_ATMEL) +static struct resource nand_resources[] = { + [0] = { + .start = AT91_CHIPSELECT_3, + .size = SZ_256M, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = AT91_BASE_SYS + AT91_ECC, + .size = 512, + .flags = IORESOURCE_MEM, + } +}; + void at91_add_device_nand(struct atmel_nand_data *data) { unsigned long csa; @@ -85,8 +111,8 @@ void at91_add_device_nand(struct atmel_nand_data *data) if (data->det_pin) at91_set_gpio_input(data->det_pin, 1); - add_generic_device("atmel_nand", 0, NULL, AT91_CHIPSELECT_3, 0x10, - IORESOURCE_MEM, data); + add_generic_device_res("atmel_nand", 0, nand_resources, + ARRAY_SIZE(nand_resources), data); } #else void at91_add_device_nand(struct atmel_nand_data *data) {} diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index c6a3dba901..3f69b1886c 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -26,6 +26,23 @@ void at91_add_device_sdram(u32 size) arm_add_mem_device("ram0", AT91_CHIPSELECT_1, size); } +/* -------------------------------------------------------------------- + * USB Host + * -------------------------------------------------------------------- */ + +#if defined(CONFIG_USB_OHCI) +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) +{ + if (!data) + return; + + add_generic_device("at91_ohci", -1, NULL, AT91SAM9261_UHP_BASE, 1024 * 1024, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} +#endif + #if defined(CONFIG_NAND_ATMEL) void at91_add_device_nand(struct atmel_nand_data *data) { diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index c7ae45ad30..994a975cf9 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c @@ -26,6 +26,31 @@ void at91_add_device_sdram(u32 size) arm_add_mem_device("ram0", AT91_CHIPSELECT_1, size); } +/* -------------------------------------------------------------------- + * USB Host + * -------------------------------------------------------------------- */ + +#if defined(CONFIG_USB_OHCI) +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) +{ + int i; + + if (!data) + return; + + /* Enable VBus control for UHP ports */ + for (i = 0; i < data->ports; i++) { + if (data->vbus_pin[i]) + at91_set_gpio_output(data->vbus_pin[i], 0); + } + + add_generic_device("at91_ohci", -1, NULL, AT91SAM9263_UHP_BASE, 1024 * 1024, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} +#endif + #if defined(CONFIG_DRIVER_NET_MACB) void at91_add_device_eth(struct at91_ether_platform_data *data) { @@ -62,6 +87,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {} #endif #if defined(CONFIG_NAND_ATMEL) +static struct resource nand_resources[] = { + [0] = { + .start = AT91_CHIPSELECT_3, + .size = SZ_256M, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = AT91_BASE_SYS + AT91_ECC0, + .size = 512, + .flags = IORESOURCE_MEM, + } +}; + void at91_add_device_nand(struct atmel_nand_data *data) { unsigned long csa; @@ -84,8 +122,8 @@ void at91_add_device_nand(struct atmel_nand_data *data) if (data->det_pin) at91_set_gpio_input(data->det_pin, 1); - add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10, - IORESOURCE_MEM, data); + add_generic_device_res("atmel_nand", -1, nand_resources, + ARRAY_SIZE(nand_resources), data); } #else void at91_add_device_nand(struct atmel_nand_data *data) {} diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 7a1d6dd2f4..7ca2ef4f48 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c @@ -37,7 +37,7 @@ #include <mach/at91_pmc.h> #include <mach/at91_rstc.h> #include <mach/io.h> -#include <asm/io.h> +#include <io.h> uint64_t at91sam9_clocksource_read(void) { diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 022f3e1875..1d47dcfa10 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c @@ -26,6 +26,31 @@ void at91_add_device_sdram(u32 size) arm_add_mem_device("ram0", AT91_CHIPSELECT_6, size); } +/* -------------------------------------------------------------------- + * USB Host (OHCI) + * -------------------------------------------------------------------- */ + +#if defined(CONFIG_USB_OHCI) +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) +{ + int i; + + if (!data) + return; + + /* Enable VBus control for UHP ports */ + for (i = 0; i < data->ports; i++) { + if (data->vbus_pin[i]) + at91_set_gpio_output(data->vbus_pin[i], 0); + } + + add_generic_device("at91_ohci", -1, NULL, AT91SAM9G45_OHCI_BASE, 1024 * 1024, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} +#endif + #if defined(CONFIG_DRIVER_NET_MACB) void at91_add_device_eth(struct at91_ether_platform_data *data) { @@ -63,6 +88,19 @@ void at91_add_device_eth(struct at91_ether_platform_data *data) {} #endif #if defined(CONFIG_NAND_ATMEL) +static struct resource nand_resources[] = { + [0] = { + .start = AT91_CHIPSELECT_3, + .size = SZ_256M, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = AT91_BASE_SYS + AT91_ECC, + .size = 512, + .flags = IORESOURCE_MEM, + } +}; + void at91_add_device_nand(struct atmel_nand_data *data) { unsigned long csa; @@ -70,9 +108,6 @@ void at91_add_device_nand(struct atmel_nand_data *data) if (!data) return; - data->ecc_base = (void __iomem *)(AT91_BASE_SYS + AT91_ECC); - data->ecc_mode = NAND_ECC_HW; - csa = at91_sys_read(AT91_MATRIX_EBICSA); at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); @@ -88,8 +123,8 @@ void at91_add_device_nand(struct atmel_nand_data *data) if (data->det_pin) at91_set_gpio_input(data->det_pin, 1); - add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10, - IORESOURCE_MEM, data); + add_generic_device_res("atmel_nand", -1, nand_resources, + ARRAY_SIZE(nand_resources), data); } #else void at91_add_device_nand(struct atmel_nand_data *data) {} @@ -256,3 +291,44 @@ void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data) void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data) {} #endif +#if defined(CONFIG_DRIVER_SPI_ATMEL) +/* SPI */ +void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) +{ + int i; + int cs_pin; + resource_size_t start; + + for (i = 0; i < pdata->num_chipselect; i++) { + cs_pin = pdata->chipselect[i]; + + /* enable chip-select pin */ + if (cs_pin > 0) + at91_set_gpio_output(cs_pin, 1); + } + + /* Configure SPI bus(es) */ + if (spi_id == 0) { + start = AT91SAM9G45_BASE_SPI0; + at91_set_A_periph(AT91_PIN_PB0, 0); /* SPI0_MISO */ + at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI0_MOSI */ + at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI0_SPCK */ + + add_generic_device("atmel_spi", spi_id, NULL, start, SZ_16K, + IORESOURCE_MEM, pdata); + } + + else if (spi_id == 1) { + start = AT91SAM9G45_BASE_SPI1; + at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_MISO */ + at91_set_A_periph(AT91_PIN_PB15, 0); /* SPI1_MOSI */ + at91_set_A_periph(AT91_PIN_PB16, 0); /* SPI1_SPCK */ + + add_generic_device("atmel_spi", spi_id, NULL, start, SZ_16K, + IORESOURCE_MEM, pdata); + } +} + +#else +void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) {} +#endif diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 528994f630..0406382daf 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -530,11 +530,12 @@ static void at91_upll_usbfs_clock_init(unsigned long main_clock) /* Now set uhpck values */ uhpck.parent = &utmi_clk; uhpck.pmc_mask = AT91SAM926x_PMC_UHP; - uhpck.rate_hz = utmi_clk.parent->rate_hz; + uhpck.rate_hz = utmi_clk.rate_hz; uhpck.rate_hz /= 1 + ((at91_sys_read(AT91_PMC_USB) & AT91_PMC_OHCIUSBDIV) >> 8); } static int pll_overclock = 0; +static u32 cpu_freq = 0; int at91_clock_init(unsigned long main_clock) { @@ -622,6 +623,8 @@ int at91_clock_init(unsigned long main_clock) mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ } + cpu_freq = freq; + /* Register the PMC's standard clocks */ for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) at91_clk_add(standard_pmc_clocks[i]); @@ -649,8 +652,8 @@ static int at91_clock_display(void) if (pll_overclock) pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); - printf("Clocks: CPU %lu MHz, master %u MHz, main %u.%03u MHz\n", - mck.parent->rate_hz / 1000000, (unsigned) mck.rate_hz / 1000000, + printf("Clocks: CPU %u MHz, master %u MHz, main %u.%03u MHz\n", + cpu_freq / 1000000, (unsigned) mck.rate_hz / 1000000, (unsigned) main_clk.rate_hz / 1000000, ((unsigned) main_clk.rate_hz % 1000000) / 1000); diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index b257128da6..c34df0520e 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c @@ -24,7 +24,7 @@ #include <common.h> #include <linux/clk.h> #include <errno.h> -#include <asm/io.h> +#include <io.h> #include <mach/gpio.h> #include <gpio.h> diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 89caebb9c2..546fe90e82 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h @@ -22,13 +22,20 @@ #define __ASM_ARCH_BOARD_H #include <net.h> +#include <spi/spi.h> #include <linux/mtd/mtd.h> + /* USB Host */ +struct at91_usbh_data { + u8 ports; /* number of ports on root hub */ + u8 vbus_pin[2]; /* port power-control pin */ +}; +extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); + void atmel_nand_load_image(void *dest, int size, int pagesize, int blocksize); /* NAND / SmartMedia */ struct atmel_nand_data { - void __iomem *ecc_base; u8 enable_pin; /* chip enable */ u8 det_pin; /* card detect */ u8 rdy_pin; /* ready/busy */ @@ -75,4 +82,12 @@ struct atmel_mci_platform_data { }; void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data); + +/* SPI Master platform data */ +struct at91_spi_platform_data { + int *chipselect; /* array of gpio_pins */ + int num_chipselect; /* chipselect array entry count */ +}; + +void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata); #endif diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h index 7e1a9a8acd..f3239f5f42 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/include/mach/gpio.h @@ -13,7 +13,7 @@ #ifndef __ASM_ARCH_AT91_GPIO_H #define __ASM_ARCH_AT91_GPIO_H -#include <asm/io.h> +#include <io.h> #include <asm-generic/errno.h> #include <mach/at91_pio.h> #include <mach/hardware.h> diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h index f09b2df0e3..7b0cd9dcbb 100644 --- a/arch/arm/mach-at91/include/mach/io.h +++ b/arch/arm/mach-at91/include/mach/io.h @@ -21,7 +21,7 @@ #ifndef __ASM_ARCH_IO_H #define __ASM_ARCH_IO_H -#include <asm/io.h> +#include <io.h> static inline unsigned int at91_sys_read(unsigned int reg_offset) { diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c index 3e7de2fc58..c397fe46b5 100644 --- a/arch/arm/mach-at91/sam9_smc.c +++ b/arch/arm/mach-at91/sam9_smc.c @@ -9,7 +9,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> #include <mach/io.h> diff --git a/arch/arm/mach-ep93xx/clocksource.c b/arch/arm/mach-ep93xx/clocksource.c index b500948968..ce8a29fee7 100644 --- a/arch/arm/mach-ep93xx/clocksource.c +++ b/arch/arm/mach-ep93xx/clocksource.c @@ -23,7 +23,7 @@ #include <common.h> #include <init.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> #include <mach/ep93xx-regs.h> #define TIMER_CLKSEL (1 << 3) diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c index 5d57434031..f4def289e4 100644 --- a/arch/arm/mach-ep93xx/gpio.c +++ b/arch/arm/mach-ep93xx/gpio.c @@ -20,7 +20,7 @@ #include <common.h> #include <errno.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/ep93xx-regs.h> #define EP93XX_GPIO_NUM_PORTS 8 diff --git a/arch/arm/mach-ep93xx/led.c b/arch/arm/mach-ep93xx/led.c index 6d6b90235f..91f33d1aea 100644 --- a/arch/arm/mach-ep93xx/led.c +++ b/arch/arm/mach-ep93xx/led.c @@ -21,7 +21,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/ep93xx-regs.h> #define GREEN_LED_POS 0x01 diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 8dc6a24fb5..8d5bd744e8 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -497,6 +497,12 @@ config IMX_IIM Device driver for the IC Identification Module (IIM) fusebox. Use the regular md/mw commands to program and read the fusebox. + Fuses are grouped in "rows", 8 bits per row. When using md/mw commands, + employ the -b switch and consider the region to be specifying the "Fuse + Row Index" rather than "Fuse Row Offset" (which is FRI * 4). You should + consult the documentation for your chip for more elaborate description, + including the eFuse map, e.g. see AN3682 for i.MX25. + config IMX_IIM_FUSE_BLOW bool "IIM fuses blow support" depends on IMX_IIM @@ -507,6 +513,10 @@ config IMX_IIM_FUSE_BLOW Warning: blown fuses can not be unblown. Using this option may damage your CPU, or make it unbootalbe. Use with care. + Before being actually able to blow the fuses, you need to explicitely + enable it: + imx_iim0.permanent_write_enable=1 + endmenu endif diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c index 8482b60f40..f13d956bf1 100644 --- a/arch/arm/mach-imx/boot.c +++ b/arch/arm/mach-imx/boot.c @@ -19,7 +19,7 @@ #include <environment.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #if defined(CONFIG_ARCH_IMX25) || defined(CONFIG_ARCH_IMX35) diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c index 5397da03d7..4f5895c2a5 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -35,7 +35,7 @@ #include <notifier.h> #include <mach/imx-regs.h> #include <mach/clock.h> -#include <asm/io.h> +#include <io.h> #define GPT(x) __REG(IMX_TIM1_BASE + (x)) #define timer_base (IMX_TIM1_BASE) diff --git a/arch/arm/mach-imx/gpio.c b/arch/arm/mach-imx/gpio.c index 0a3e0461eb..fdee20b865 100644 --- a/arch/arm/mach-imx/gpio.c +++ b/arch/arm/mach-imx/gpio.c @@ -25,7 +25,7 @@ #include <common.h> #include <errno.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/gpio.h> diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c index ca89710329..f2ace8aa0f 100644 --- a/arch/arm/mach-imx/iim.c +++ b/arch/arm/mach-imx/iim.c @@ -25,7 +25,7 @@ #include <fcntl.h> #include <malloc.h> -#include <asm/io.h> +#include <io.h> #include <mach/iim.h> @@ -51,8 +51,8 @@ static int do_fuse_sense(void __iomem *reg_base, unsigned int bank, return -EINVAL; } - if (row > 0x3ff) { - printf("%s: invalid row offset\n", __func__); + if (row > 255) { + printf("%s: invalid row index\n", __func__); return -EINVAL; } @@ -61,8 +61,8 @@ static int do_fuse_sense(void __iomem *reg_base, unsigned int bank, writeb(0xfe, reg_base + IIM_ERR); /* upper and lower address halves */ - writeb((bank << 3) | (row >> 7), reg_base + IIM_UA); - writeb((row << 1) & 0xf8, reg_base + IIM_LA); + writeb((bank << 3) | (row >> 5), reg_base + IIM_UA); + writeb((row << 3) & 0xf8, reg_base + IIM_LA); /* start fuse sensing */ writeb(0x08, reg_base + IIM_FCTL); @@ -100,7 +100,7 @@ static ssize_t imx_iim_cdev_read(struct cdev *cdev, void *buf, size_t count, int row_val; row_val = do_fuse_sense(priv->base, - priv->bank, (offset + i) * 4); + priv->bank, offset + i); if (row_val < 0) return row_val; ((u8 *)buf)[i] = (u8)row_val; @@ -125,8 +125,8 @@ static int do_fuse_blow(void __iomem *reg_base, unsigned int bank, return -EINVAL; } - if (row > 0x3ff) { - printf("%s: invalid row offset\n", __func__); + if (row > 255) { + printf("%s: invalid row index\n", __func__); return -EINVAL; } @@ -138,14 +138,14 @@ static int do_fuse_blow(void __iomem *reg_base, unsigned int bank, writeb(0xaa, reg_base + IIM_PREG_P); /* upper half address register */ - writeb((bank << 3) | (row >> 7), reg_base + IIM_UA); + writeb((bank << 3) | (row >> 5), reg_base + IIM_UA); for (bit = 0; bit < 8; bit++) { if (((value >> bit) & 1) == 0) continue; /* lower half address register */ - writeb(((row << 1) | bit), reg_base + IIM_LA); + writeb(((row << 3) | bit), reg_base + IIM_LA); /* start fuse programing */ writeb(0x71, reg_base + IIM_FCTL); @@ -193,7 +193,7 @@ static ssize_t imx_iim_cdev_write(struct cdev *cdev, const void *buf, size_t cou int ret; ret = do_fuse_blow(priv->base, priv->bank, - (offset + i) * 4, ((u8 *)buf)[i]); + offset + i, ((u8 *)buf)[i]); if (ret < 0) return ret; } diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c index 75ec8c7f45..19a2909e18 100644 --- a/arch/arm/mach-imx/imx25.c +++ b/arch/arm/mach-imx/imx25.c @@ -19,7 +19,7 @@ #include <init.h> #include <mach/imx-regs.h> #include <mach/iim.h> -#include <asm/io.h> +#include <io.h> #include <sizes.h> #include "gpio.h" diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c index c846260682..381a564580 100644 --- a/arch/arm/mach-imx/imx35.c +++ b/arch/arm/mach-imx/imx35.c @@ -18,7 +18,7 @@ #include <common.h> #include <sizes.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/iim.h> #include <mach/generic.h> diff --git a/arch/arm/mach-imx/imx51.c b/arch/arm/mach-imx/imx51.c index a42ff41400..2c1efed150 100644 --- a/arch/arm/mach-imx/imx51.c +++ b/arch/arm/mach-imx/imx51.c @@ -19,7 +19,7 @@ #include <common.h> #include <sizes.h> #include <environment.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx51-regs.h> #include "gpio.h" diff --git a/arch/arm/mach-imx/imx53.c b/arch/arm/mach-imx/imx53.c index 7a822c2c85..8fb64bb96a 100644 --- a/arch/arm/mach-imx/imx53.c +++ b/arch/arm/mach-imx/imx53.c @@ -17,7 +17,7 @@ #include <init.h> #include <common.h> -#include <asm/io.h> +#include <io.h> #include <sizes.h> #include <mach/imx53-regs.h> diff --git a/arch/arm/mach-imx/include/mach/clock-imx51_53.h b/arch/arm/mach-imx/include/mach/clock-imx51_53.h index 34ca1bb94f..1e90d21d4a 100644 --- a/arch/arm/mach-imx/include/mach/clock-imx51_53.h +++ b/arch/arm/mach-imx/include/mach/clock-imx51_53.h @@ -606,6 +606,10 @@ #define MX5_PLL_DP_MFD_665 (96 - 1) #define MX5_PLL_DP_MFN_665 89 +#define MX5_PLL_DP_OP_600 ((6 << 4) + ((1 - 1) << 0)) +#define MX5_PLL_DP_MFD_600 (4 - 1) +#define MX5_PLL_DP_MFN_600 1 + #define MX5_PLL_DP_OP_532 ((5 << 4) + ((1 - 1) << 0)) #define MX5_PLL_DP_MFD_532 (24 - 1) #define MX5_PLL_DP_MFN_532 13 diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h index 5b590a251e..10821782fe 100644 --- a/arch/arm/mach-imx/include/mach/clock.h +++ b/arch/arm/mach-imx/include/mach/clock.h @@ -29,6 +29,7 @@ ulong imx_get_uartclk(void); ulong imx_get_lcdclk(void); ulong imx_get_i2cclk(void); ulong imx_get_mmcclk(void); +ulong imx_get_cspiclk(void); int imx_clko_set_div(int div); void imx_clko_set_src(int src); diff --git a/arch/arm/mach-imx/include/mach/devices-imx25.h b/arch/arm/mach-imx/include/mach/devices-imx25.h index 87f5ba0e5e..eff59773f7 100644 --- a/arch/arm/mach-imx/include/mach/devices-imx25.h +++ b/arch/arm/mach-imx/include/mach/devices-imx25.h @@ -6,6 +6,11 @@ static inline struct device_d *imx25_add_i2c0(struct i2c_platform_data *pdata) return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata); } +static inline struct device_d *imx25_add_spi0(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)IMX_CSPI1_BASE, 0, pdata); +} + static inline struct device_d *imx25_add_uart0(void) { return imx_add_uart((void *)IMX_UART1_BASE, 0); diff --git a/arch/arm/mach-imx/include/mach/devices-imx51.h b/arch/arm/mach-imx/include/mach/devices-imx51.h index a5deb5c863..54ea647461 100644 --- a/arch/arm/mach-imx/include/mach/devices-imx51.h +++ b/arch/arm/mach-imx/include/mach/devices-imx51.h @@ -1,5 +1,6 @@ #include <mach/devices.h> +#include <sizes.h> static inline struct device_d *imx51_add_spi0(struct spi_imx_master *pdata) { @@ -53,6 +54,28 @@ static inline struct device_d *imx51_add_mmc1(void *pdata) static inline struct device_d *imx51_add_nand(struct imx_nand_platform_data *pdata) { - return imx_add_nand((void *)MX51_NFC_AXI_BASE_ADDR, pdata); + struct resource res[] = { + { + .start = MX51_NFC_BASE_ADDR, + .size = SZ_4K, + .flags = IORESOURCE_MEM, + }, { + .start = MX51_NFC_AXI_BASE_ADDR, + .size = SZ_4K, + .flags = IORESOURCE_MEM, + }, + }; + struct device_d *dev = xzalloc(sizeof(*dev)); + + dev->resource = xzalloc(sizeof(struct resource) * ARRAY_SIZE(res)); + memcpy(dev->resource, res, sizeof(struct resource) * ARRAY_SIZE(res)); + dev->num_resources = ARRAY_SIZE(res); + strcpy(dev->name, "imx_nand"); + dev->id = -1; + dev->platform_data = pdata; + + register_device(dev); + + return dev; } diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h index 78ec0cdbf1..73307c452e 100644 --- a/arch/arm/mach-imx/include/mach/imx25-regs.h +++ b/arch/arm/mach-imx/include/mach/imx25-regs.h @@ -47,6 +47,7 @@ #define IMX_NFC_BASE 0xBB000000 #define IMX_FEC_BASE 0x50038000 #define IMX_I2C1_BASE 0x43F80000 +#define IMX_CSPI1_BASE 0x43FA4000 /* * Clock Controller Module (CCM) diff --git a/arch/arm/mach-imx/include/mach/imx51-regs.h b/arch/arm/mach-imx/include/mach/imx51-regs.h index 2e6cacb5bf..c6d14cdc6b 100644 --- a/arch/arm/mach-imx/include/mach/imx51-regs.h +++ b/arch/arm/mach-imx/include/mach/imx51-regs.h @@ -12,6 +12,16 @@ #define GPT_TCN 0x24 #define GPT_TSTAT 0x08 +/* WEIM registers */ +#define WEIM_CSxGCR1(n) (((n) * 0x18) + 0x00) +#define WEIM_CSxGCR2(n) (((n) * 0x18) + 0x04) +#define WEIM_CSxRCR1(n) (((n) * 0x18) + 0x08) +#define WEIM_CSxRCR2(n) (((n) * 0x18) + 0x0c) +#define WEIM_CSxWCR1(n) (((n) * 0x18) + 0x10) +#define WEIM_WCR 0x90 +#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 */ @@ -134,4 +144,3 @@ #define MX51_CHIP_REV_3_2 0x32 #endif /* __MACH_IMX51_REGS_H */ - diff --git a/arch/arm/mach-imx/internal-nand-boot.c b/arch/arm/mach-imx/internal-nand-boot.c index 0d71b99f92..c55a0e7682 100644 --- a/arch/arm/mach-imx/internal-nand-boot.c +++ b/arch/arm/mach-imx/internal-nand-boot.c @@ -17,7 +17,7 @@ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <linux/mtd/nand.h> #include <mach/imx-nand.h> #include <mach/generic.h> diff --git a/arch/arm/mach-imx/iomux-v2.c b/arch/arm/mach-imx/iomux-v2.c index abb2ebe195..1b49ccb328 100644 --- a/arch/arm/mach-imx/iomux-v2.c +++ b/arch/arm/mach-imx/iomux-v2.c @@ -18,7 +18,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/iomux-mx31.h> diff --git a/arch/arm/mach-imx/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c index a74f942509..bb2307a370 100644 --- a/arch/arm/mach-imx/iomux-v3.c +++ b/arch/arm/mach-imx/iomux-v3.c @@ -19,7 +19,7 @@ * MA 02110-1301, USA. */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/iomux-v3.h> #include <mach/imx-regs.h> diff --git a/arch/arm/mach-imx/nand.c b/arch/arm/mach-imx/nand.c index c52b8b06c2..fcbb85ef68 100644 --- a/arch/arm/mach-imx/nand.c +++ b/arch/arm/mach-imx/nand.c @@ -17,7 +17,7 @@ #include <common.h> #include <mach/imx-regs.h> -#include <asm/io.h> +#include <io.h> #if defined(CONFIG_ARCH_IMX35) || defined (CONFIG_ARCH_IMX25) diff --git a/arch/arm/mach-imx/speed-imx25.c b/arch/arm/mach-imx/speed-imx25.c index 68b50e943b..f6dcacb71b 100644 --- a/arch/arm/mach-imx/speed-imx25.c +++ b/arch/arm/mach-imx/speed-imx25.c @@ -1,6 +1,6 @@ #include <common.h> #include <mach/imx-regs.h> -#include <asm/io.h> +#include <io.h> #include <mach/clock.h> #include <init.h> @@ -87,6 +87,11 @@ unsigned long imx_get_mmcclk(void) return imx_get_perclk(3); } +unsigned long imx_get_cspiclk(void) +{ + return imx_get_ipgclk(); +} + void imx_dump_clocks(void) { printf("mpll: %10ld Hz\n", imx_get_mpllclk()); diff --git a/arch/arm/mach-imx/speed-imx31.c b/arch/arm/mach-imx/speed-imx31.c index 32a517d724..d3f168c4ae 100644 --- a/arch/arm/mach-imx/speed-imx31.c +++ b/arch/arm/mach-imx/speed-imx31.c @@ -16,7 +16,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/clock.h> #include <init.h> diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c index b2a339c6c2..1e1c39ff82 100644 --- a/arch/arm/mach-imx/speed-imx35.c +++ b/arch/arm/mach-imx/speed-imx35.c @@ -17,7 +17,7 @@ #include <common.h> #include <mach/imx-regs.h> -#include <asm/io.h> +#include <io.h> #include <mach/clock.h> #include <mach/generic.h> #include <init.h> diff --git a/arch/arm/mach-imx/speed-imx51.c b/arch/arm/mach-imx/speed-imx51.c index f1fb74c474..643ad8f39b 100644 --- a/arch/arm/mach-imx/speed-imx51.c +++ b/arch/arm/mach-imx/speed-imx51.c @@ -1,5 +1,5 @@ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <asm-generic/div64.h> #include <mach/imx51-regs.h> #include <mach/clock-imx51_53.h> @@ -156,6 +156,11 @@ unsigned long imx_get_fecclk(void) return imx_get_ipgclk(); } +unsigned long imx_get_i2cclk(void) +{ + return imx_get_ipgclk(); +} + unsigned long imx_get_mmcclk(void) { u32 reg, prediv, podf, rate; diff --git a/arch/arm/mach-imx/speed-imx53.c b/arch/arm/mach-imx/speed-imx53.c index 7b099f5fa6..0d6ac24944 100644 --- a/arch/arm/mach-imx/speed-imx53.c +++ b/arch/arm/mach-imx/speed-imx53.c @@ -1,5 +1,5 @@ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <asm-generic/div64.h> #include <mach/imx-regs.h> #include "mach/clock-imx51_53.h" diff --git a/arch/arm/mach-mxs/clocksource-imx23.c b/arch/arm/mach-mxs/clocksource-imx23.c index f7c94c1d75..66e534bda3 100644 --- a/arch/arm/mach-mxs/clocksource-imx23.c +++ b/arch/arm/mach-mxs/clocksource-imx23.c @@ -23,7 +23,7 @@ #include <notifier.h> #include <mach/imx-regs.h> #include <mach/clock.h> -#include <asm/io.h> +#include <io.h> #define TIMROTCTRL 0x00 #define TIMCTRL1 0x40 diff --git a/arch/arm/mach-mxs/clocksource-imx28.c b/arch/arm/mach-mxs/clocksource-imx28.c index 15ae951004..328ca5d023 100644 --- a/arch/arm/mach-mxs/clocksource-imx28.c +++ b/arch/arm/mach-mxs/clocksource-imx28.c @@ -18,7 +18,7 @@ #include <notifier.h> #include <mach/imx-regs.h> #include <mach/clock.h> -#include <asm/io.h> +#include <io.h> #define TIMROTCTRL 0x00 # define TIMROTCTRL_SFTRST diff --git a/arch/arm/mach-mxs/imx_lcd_clk.c b/arch/arm/mach-mxs/imx_lcd_clk.c index 65bfc6ee3d..455dfcb9c7 100644 --- a/arch/arm/mach-mxs/imx_lcd_clk.c +++ b/arch/arm/mach-mxs/imx_lcd_clk.c @@ -16,7 +16,7 @@ #include <init.h> #include <mach/imx-regs.h> #include <mach/clock.h> -#include <asm/io.h> +#include <io.h> #ifdef CONFIG_ARCH_IMX23 diff --git a/arch/arm/mach-mxs/iomux-imx.c b/arch/arm/mach-mxs/iomux-imx.c index bf6165f8d2..3161a5d3cc 100644 --- a/arch/arm/mach-mxs/iomux-imx.c +++ b/arch/arm/mach-mxs/iomux-imx.c @@ -21,7 +21,7 @@ #include <init.h> #include <gpio.h> #include <errno.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #define HW_PINCTRL_CTRL 0x000 diff --git a/arch/arm/mach-mxs/reset-imx.c b/arch/arm/mach-mxs/reset-imx.c index b35f796b40..cfb3548f2a 100644 --- a/arch/arm/mach-mxs/reset-imx.c +++ b/arch/arm/mach-mxs/reset-imx.c @@ -21,7 +21,7 @@ #include <init.h> #include <notifier.h> #include <mach/imx-regs.h> -#include <asm/io.h> +#include <io.h> #define HW_RTC_CTRL 0x000 # define BM_RTC_CTRL_WATCHDOGEN (1 << 4) diff --git a/arch/arm/mach-mxs/speed-imx23.c b/arch/arm/mach-mxs/speed-imx23.c index a31139d7a7..b10c78643c 100644 --- a/arch/arm/mach-mxs/speed-imx23.c +++ b/arch/arm/mach-mxs/speed-imx23.c @@ -24,7 +24,7 @@ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/generic.h> #include <mach/clock.h> diff --git a/arch/arm/mach-mxs/speed-imx28.c b/arch/arm/mach-mxs/speed-imx28.c index 63c6b0754b..67cdbdf81d 100644 --- a/arch/arm/mach-mxs/speed-imx28.c +++ b/arch/arm/mach-mxs/speed-imx28.c @@ -18,7 +18,7 @@ */ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #include <mach/generic.h> #include <mach/clock.h> diff --git a/arch/arm/mach-mxs/usb.c b/arch/arm/mach-mxs/usb.c index d232bb6075..b7a93769b7 100644 --- a/arch/arm/mach-mxs/usb.c +++ b/arch/arm/mach-mxs/usb.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/imx-regs.h> #define POWER_CTRL (IMX_POWER_BASE + 0x0) diff --git a/arch/arm/mach-nomadik/reset.c b/arch/arm/mach-nomadik/reset.c index d55f278293..6ea74dd6c0 100644 --- a/arch/arm/mach-nomadik/reset.c +++ b/arch/arm/mach-nomadik/reset.c @@ -18,7 +18,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> void __noreturn reset_cpu(unsigned long addr) diff --git a/arch/arm/mach-nomadik/timer.c b/arch/arm/mach-nomadik/timer.c index 7de1f391a6..becd36357a 100644 --- a/arch/arm/mach-nomadik/timer.c +++ b/arch/arm/mach-nomadik/timer.c @@ -11,7 +11,7 @@ #include <common.h> #include <init.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> #include <mach/mtu.h> #include <mach/timex.h> diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c index 76ceb20024..197d4be418 100644 --- a/arch/arm/mach-omap/devices-gpmc-nand.c +++ b/arch/arm/mach-omap/devices-gpmc-nand.c @@ -31,7 +31,7 @@ #include <init.h> #include <driver.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> #include <mach/silicon.h> #include <mach/gpmc.h> diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c index b0bd805628..142cf524eb 100644 --- a/arch/arm/mach-omap/gpio.c +++ b/arch/arm/mach-omap/gpio.c @@ -37,7 +37,7 @@ */ #include <common.h> #include <mach/gpio.h> -#include <asm/io.h> +#include <io.h> #include <errno.h> #ifdef CONFIG_ARCH_OMAP3 diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c index 2b9964950d..e8946d7c56 100644 --- a/arch/arm/mach-omap/gpmc.c +++ b/arch/arm/mach-omap/gpmc.c @@ -29,7 +29,7 @@ */ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/silicon.h> #include <mach/gpmc.h> #include <mach/sys_info.h> diff --git a/arch/arm/mach-omap/include/mach/omap3-silicon.h b/arch/arm/mach-omap/include/mach/omap3-silicon.h index 0e6a45f8fd..67f77476a9 100644 --- a/arch/arm/mach-omap/include/mach/omap3-silicon.h +++ b/arch/arm/mach-omap/include/mach/omap3-silicon.h @@ -132,5 +132,8 @@ #define OMAP_SDRC_CS0 0x80000000 #define OMAP_SDRC_CS1 0xA0000000 +/* PRM */ +#define PRM_RSTCTRL_RESET 0x04 + #endif /* __ASM_ARCH_OMAP3_H */ diff --git a/arch/arm/mach-omap/include/mach/omap_hsmmc.h b/arch/arm/mach-omap/include/mach/omap_hsmmc.h new file mode 100644 index 0000000000..a15f8e62a2 --- /dev/null +++ b/arch/arm/mach-omap/include/mach/omap_hsmmc.h @@ -0,0 +1,28 @@ +/** + * @file + * @brief This file contains exported structure for OMAP hsmmc + * + * FileName: include/asm-arm/arch-omap/omap_hsmmc.h + * + * OMAP3 and OMAP4 has a MMC/SD controller embedded. + * This file provides the platform data structure required to + * addapt to platform specialities. + */ +/* + * (C) Copyright 2011 + * Phytec Messtechnik GmbH, <www.phytec.de> + * Juergen Kilb <j.kilb@phytec.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_OMAP_HSMMC_H +#define __ASM_OMAP_HSMMC_H + +/** omapmmc platform data structure */ +struct omap_hsmmc_platform_data { + unsigned f_max; /* host interface upper limit */ +}; +#endif /* __ASM_OMAP_HSMMC_H */ diff --git a/arch/arm/mach-omap/include/mach/sys_info.h b/arch/arm/mach-omap/include/mach/sys_info.h index f557068345..f0594bf2b7 100644 --- a/arch/arm/mach-omap/include/mach/sys_info.h +++ b/arch/arm/mach-omap/include/mach/sys_info.h @@ -91,6 +91,7 @@ u32 get_cpu_type(void); u32 get_cpu_rev(void); u32 get_sdr_cs_size(u32 offset); +u32 get_sdr_cs1_base(void); inline u32 get_sysboot_value(void); u32 get_gpmc0_base(void); u32 get_base(void); diff --git a/arch/arm/mach-omap/include/mach/syslib.h b/arch/arm/mach-omap/include/mach/syslib.h index 65aca0297f..1909f172a6 100644 --- a/arch/arm/mach-omap/include/mach/syslib.h +++ b/arch/arm/mach-omap/include/mach/syslib.h @@ -30,7 +30,7 @@ */ #ifndef __ASM_ARCH_OMAP_SYSLIB_H_ #define __ASM_ARCH_OMAP_SYSLIB_H_ -#include <asm/io.h> +#include <io.h> /** System Independent functions */ diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c index 3a0ab24e58..412d7b714c 100644 --- a/arch/arm/mach-omap/omap3_clock.c +++ b/arch/arm/mach-omap/omap3_clock.c @@ -39,7 +39,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/silicon.h> #include <mach/clocks.h> #include <mach/timers.h> diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c index 661a971fc0..fc83d23713 100644 --- a/arch/arm/mach-omap/omap3_generic.c +++ b/arch/arm/mach-omap/omap3_generic.c @@ -36,7 +36,7 @@ */ #include <common.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/silicon.h> #include <mach/gpmc.h> #include <mach/sdrc.h> @@ -59,8 +59,9 @@ */ void __noreturn reset_cpu(unsigned long addr) { - /* FIXME: Enable WDT and cause reset */ - hang(); + writel(PRM_RSTCTRL_RESET, PRM_REG(RSTCTRL)); + + while (1); } EXPORT_SYMBOL(reset_cpu); @@ -177,7 +178,26 @@ u32 get_sdr_cs_size(u32 offset) size *= 2 * (1024 * 1024); /* find size in MB */ return size; } +EXPORT_SYMBOL(get_sdr_cs_size); +/** + * @brief base address of chip select 1 (cs0 is defined at 0x80000000) + * + * @return return the CS1 base address. + */ +u32 get_sdr_cs1_base(void) +{ + u32 base; + u32 cs_cfg; + cs_cfg = readl(SDRC_REG(CS_CFG)); + /* get ram size field */ + base = (cs_cfg & 0x0000000F) << 2; /* get CS1STARTHIGH */ + base = base | ((cs_cfg & 0x00000300) >> 8); /* get CS1STARTLOW */ + base = base << 25; + base += 0x80000000; + return base; +} +EXPORT_SYMBOL(get_sdr_cs1_base); /** * @brief Get the initial SYSBOOT value * diff --git a/arch/arm/mach-omap/omap4_clock.c b/arch/arm/mach-omap/omap4_clock.c index 23a77d06f1..f8bab5f93a 100644 --- a/arch/arm/mach-omap/omap4_clock.c +++ b/arch/arm/mach-omap/omap4_clock.c @@ -1,6 +1,6 @@ #include <common.h> #include <mach/syslib.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-clock.h> #define LDELAY 12000000 diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c index 313e5e997b..5223c7e757 100644 --- a/arch/arm/mach-omap/omap4_generic.c +++ b/arch/arm/mach-omap/omap4_generic.c @@ -1,7 +1,7 @@ #include <common.h> #include <init.h> #include <mach/silicon.h> -#include <asm/io.h> +#include <io.h> #include <mach/omap4-silicon.h> #include <mach/omap4-clock.h> #include <mach/syslib.h> diff --git a/arch/arm/mach-omap/s32k_clksource.c b/arch/arm/mach-omap/s32k_clksource.c index 094b76d6b7..3ed9448949 100644 --- a/arch/arm/mach-omap/s32k_clksource.c +++ b/arch/arm/mach-omap/s32k_clksource.c @@ -33,7 +33,7 @@ #include <common.h> #include <clock.h> #include <init.h> -#include <asm/io.h> +#include <io.h> #include <mach/silicon.h> #include <mach/clocks.h> #include <mach/timers.h> diff --git a/arch/arm/mach-omap/syslib.c b/arch/arm/mach-omap/syslib.c index 677de6a27d..765a816147 100644 --- a/arch/arm/mach-omap/syslib.c +++ b/arch/arm/mach-omap/syslib.c @@ -32,7 +32,7 @@ #include <config.h> #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/syslib.h> /** diff --git a/arch/arm/mach-s3c24xx/generic.c b/arch/arm/mach-s3c24xx/generic.c index 4c7e799850..d2f2ac7ac0 100644 --- a/arch/arm/mach-s3c24xx/generic.c +++ b/arch/arm/mach-s3c24xx/generic.c @@ -26,7 +26,7 @@ #include <common.h> #include <init.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> #include <mach/s3c24x0-iomap.h> /** diff --git a/arch/arm/mach-s3c24xx/gpio-s3c24x0.c b/arch/arm/mach-s3c24xx/gpio-s3c24x0.c index 3d5e5e5c96..946ec3396e 100644 --- a/arch/arm/mach-s3c24xx/gpio-s3c24x0.c +++ b/arch/arm/mach-s3c24xx/gpio-s3c24x0.c @@ -17,7 +17,7 @@ #include <common.h> #include <errno.h> -#include <asm/io.h> +#include <io.h> #include <mach/s3c24x0-iomap.h> #include <mach/gpio.h> diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 1231a7db63..bdf48f97a2 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -35,7 +35,7 @@ #include <linux/clk.h> #include <linux/err.h> -#include <asm/io.h> +#include <io.h> #include <asm/hardware/arm_timer.h> #include <asm/armlinux.h> diff --git a/arch/arm/mach-versatile/include/mach/debug_ll.h b/arch/arm/mach-versatile/include/mach/debug_ll.h index 1f6162b9db..30762c93fb 100644 --- a/arch/arm/mach-versatile/include/mach/debug_ll.h +++ b/arch/arm/mach-versatile/include/mach/debug_ll.h @@ -20,7 +20,7 @@ #define __MACH_DEBUG_LL_H__ #include <linux/amba/serial.h> -#include <asm/io.h> +#include <io.h> static inline void putc(char c) { diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 581947be26..d1b39fa347 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -31,7 +31,7 @@ #include <net.h> #include <init.h> #include <environment.h> -#include <mem_malloc.h> +#include <memory.h> #include <asm/cpu.h> #include <asm-generic/memory_layout.h> diff --git a/arch/mips/boards/dlink-dir-320/serial.c b/arch/mips/boards/dlink-dir-320/serial.c index ebe8c06c7a..3eaab2a129 100644 --- a/arch/mips/boards/dlink-dir-320/serial.c +++ b/arch/mips/boards/dlink-dir-320/serial.c @@ -24,7 +24,7 @@ #include <init.h> #include <ns16550.h> #include <mach/hardware.h> -#include <asm/io.h> +#include <io.h> #include <asm/common.h> static struct NS16550_plat serial_plat = { diff --git a/arch/mips/boards/qemu-malta/serial.c b/arch/mips/boards/qemu-malta/serial.c index ef6be17f1f..502b3468bb 100644 --- a/arch/mips/boards/qemu-malta/serial.c +++ b/arch/mips/boards/qemu-malta/serial.c @@ -24,7 +24,7 @@ #include <init.h> #include <ns16550.h> #include <mach/hardware.h> -#include <asm/io.h> +#include <io.h> #include <asm/common.h> static struct NS16550_plat serial_plat = { diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S index dd9eab7970..ba4c0afc11 100644 --- a/arch/mips/lib/barebox.lds.S +++ b/arch/mips/lib/barebox.lds.S @@ -64,10 +64,6 @@ SECTIONS __usymtab : { BAREBOX_SYMS } __usymtab_end = .; - __early_init_data_begin = .; - .early_init_data : { *(.early_init_data) } - __early_init_data_end = .; - . = ALIGN(4); __bss_start = .; .bss : { *(.bss*) } diff --git a/arch/mips/lib/csrc-r4k.c b/arch/mips/lib/csrc-r4k.c index 8e93e6f6c4..1dd0928949 100644 --- a/arch/mips/lib/csrc-r4k.c +++ b/arch/mips/lib/csrc-r4k.c @@ -25,7 +25,7 @@ #include <init.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> #include <asm/mipsregs.h> static uint64_t c0_hpt_read(void) diff --git a/arch/mips/lib/memory.c b/arch/mips/lib/memory.c index 23a995c45d..ad9f6a6a40 100644 --- a/arch/mips/lib/memory.c +++ b/arch/mips/lib/memory.c @@ -20,7 +20,7 @@ #include <common.h> #include <init.h> -#include <mem_malloc.h> +#include <memory.h> #include <asm-generic/memory_layout.h> static int mips_mem_malloc_init(void) diff --git a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h index 32d13c1a87..ccc9d9bfc7 100644 --- a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h +++ b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h @@ -24,7 +24,7 @@ #ifndef __INCLUDE_ARCH_DEBUG_LL_H__ #define __INCLUDE_ARCH_DEBUG_LL_H__ -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> #define rbr 0 diff --git a/arch/mips/mach-bcm47xx/reset.c b/arch/mips/mach-bcm47xx/reset.c index 2818e7cfa3..d6fcd8dec2 100644 --- a/arch/mips/mach-bcm47xx/reset.c +++ b/arch/mips/mach-bcm47xx/reset.c @@ -24,7 +24,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> void __noreturn reset_cpu(ulong addr) diff --git a/arch/mips/mach-malta/include/mach/debug_ll.h b/arch/mips/mach-malta/include/mach/debug_ll.h index 32d13c1a87..ccc9d9bfc7 100644 --- a/arch/mips/mach-malta/include/mach/debug_ll.h +++ b/arch/mips/mach-malta/include/mach/debug_ll.h @@ -24,7 +24,7 @@ #ifndef __INCLUDE_ARCH_DEBUG_LL_H__ #define __INCLUDE_ARCH_DEBUG_LL_H__ -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> #define rbr 0 diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c index 2818e7cfa3..d6fcd8dec2 100644 --- a/arch/mips/mach-malta/reset.c +++ b/arch/mips/mach-malta/reset.c @@ -24,7 +24,7 @@ */ #include <common.h> -#include <asm/io.h> +#include <io.h> #include <mach/hardware.h> void __noreturn reset_cpu(ulong addr) diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c index 5efbd5e354..f443bfdec5 100644 --- a/arch/nios2/cpu/interrupts.c +++ b/arch/nios2/cpu/interrupts.c @@ -27,7 +27,7 @@ #include <nios2.h> #include <asm/nios2-io.h> #include <asm/types.h> -#include <asm/io.h> +#include <io.h> #include <asm/ptrace.h> #include <common.h> #include <command.h> diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c index 7cbff4032b..07f045b3aa 100644 --- a/arch/nios2/lib/board.c +++ b/arch/nios2/lib/board.c @@ -23,7 +23,7 @@ #include <common.h> #include <malloc.h> #include <init.h> -#include <mem_malloc.h> +#include <memory.h> #include <asm-generic/memory_layout.h> #include <cache.h> diff --git a/arch/nios2/lib/clock.c b/arch/nios2/lib/clock.c index 05008be793..52f52fd145 100644 --- a/arch/nios2/lib/clock.c +++ b/arch/nios2/lib/clock.c @@ -24,7 +24,7 @@ #include <clock.h> #include <init.h> #include <asm/nios2-io.h> -#include <asm/io.h> +#include <io.h> static struct nios_timer *timer = (struct nios_timer *)NIOS_SOPC_TIMER_BASE; diff --git a/arch/nios2/lib/early_printf.c b/arch/nios2/lib/early_printf.c index 637bb73b0d..50b071ba5e 100644 --- a/arch/nios2/lib/early_printf.c +++ b/arch/nios2/lib/early_printf.c @@ -23,7 +23,7 @@ #include <stdio.h> #include <common.h> #include <asm/nios2-io.h> -#include <asm/io.h> +#include <io.h> void early_putc(char ch) { diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index cda14de25d..50ccaac5f3 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig @@ -7,15 +7,6 @@ config ARCH_TEXT_BASE default 0x00000000 if RELOCATABLE default 0x01000000 if MACH_PHYCORE_MPC5200B_TINY -config MPC5XXX_EARLY_CONSOLE - bool - depends on ARCH_MPC5200 - default y - -config HAS_EARLY_INIT - bool - default y - config PPC bool select HAVE_CONFIGURABLE_TEXT_BASE diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S index 21bf4a75c7..4aacfc5f12 100644 --- a/arch/ppc/boards/pcm030/barebox.lds.S +++ b/arch/ppc/boards/pcm030/barebox.lds.S @@ -111,10 +111,6 @@ SECTIONS __usymtab : { BAREBOX_SYMS } __usymtab_end = .; - __early_init_data_begin = .; - .early_init_data : { *(.early_init_data) } - __early_init_data_end = .; - __start___ex_table = .; __ex_table : { *(__ex_table) } __stop___ex_table = .; diff --git a/arch/ppc/boards/pcm030/config.h b/arch/ppc/boards/pcm030/config.h index a772ee6d96..508e017161 100644 --- a/arch/ppc/boards/pcm030/config.h +++ b/arch/ppc/boards/pcm030/config.h @@ -29,79 +29,15 @@ #include <mach/mpc5xxx.h> -/* #define DEBUG */ - -/*------------------------------------------------------------------------------------------------------------------------------------------------------ -High Level Configuration Options -(easy to change) - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define CONFIG_MPC5200_DDR 1 /* (with DDR-SDRAM) */ #define CFG_MPC5XXX_CLKIN 33333333 /* ... running at 33.333333MHz */ -#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */ -#define BOOTFLAG_WARM 0x02 /* Software reboot */ - -/*------------------------------------------------------------------------------------------------------------------------------------------------------ -Serial console configuration - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ - -#if (TEXT_BASE == 0xFF000000) /* Boot low */ -#define CFG_LOWBOOT 1 -#endif -/* RAMBOOT will be defined automatically in memory section */ - -/*------------------------------------------------------------------------------------------------------------------------------------------------------ -IPB Bus clocking configuration. - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define CFG_IPBSPEED_133 /* define for 133MHz speed */ -#if defined(CFG_IPBSPEED_133) -/* - * PCI Bus clocking configuration - * - * Actually a PCI Clock of 66 MHz is only set (in cpu_init.c) if - * CFG_IPBSPEED_133 is defined. This is because a PCI Clock of 66 MHz yet hasn't - * been tested with a IPB Bus Clock of 66 MHz. - */ -#define CFG_PCISPEED_66 /* define for 66MHz speed */ -#else -#undef CFG_PCISPEED_66 /* for 33MHz speed */ -#endif -/* we only use CS-Boot */ -#define CFG_BOOTCS_START 0xFF000000 -#define CFG_BOOTCS_SIZE 0x01000000 - -#if CONFIG_MACH_PHYCORE_MPC5200B_TINY_REV == 1 -#define CFG_BOOTCS_CFG 0x0008FD00 -#else -#define CFG_BOOTCS_CFG 0x00083800 -#endif - -/*------------------------------------------------------------------------------------------------------------------------------------------------------ - Memory map - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define CFG_MBAR 0xF0000000 /* MBAR hast to be switched by other bootloader or debugger config */ -#define CFG_SDRAM_BASE 0x00000000 - -/* Use SRAM until RAM will be available */ -#define CFG_INIT_RAM_ADDR MPC5XXX_SRAM -#define CFG_INIT_RAM_SIZE MPC5XXX_SRAM_SIZE /* End of used area in DPRAM */ -#define CONFIG_EARLY_INITDATA_SIZE 0x100 - -#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ - -/*------------------------------------------------------------------------------------------------------------------------------------------------------ - GPIO configuration - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CFG_GPS_PORT_CONFIG 0x00558c10 /* PSC6=UART, PSC3=UART ; Ether=100MBit with MD */ -/*------------------------------------------------------------------------------------------------------------------------------------------------------ - Various low-level settings - ------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CFG_HID0_INIT HID0_ICE | HID0_ICFI #define CFG_HID0_FINAL HID0_ICE -#define CFG_CS_BURST 0x00000000 -#define CFG_CS_DEADCYCLE 0x33333333 + +#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ #define OF_CPU "PowerPC,5200@0" #define OF_TBCLK CFG_MPC5XXX_CLKIN diff --git a/arch/ppc/boards/pcm030/pcm030.c b/arch/ppc/boards/pcm030/pcm030.c index ba59bfe101..61fb11620f 100644 --- a/arch/ppc/boards/pcm030/pcm030.c +++ b/arch/ppc/boards/pcm030/pcm030.c @@ -34,8 +34,10 @@ #include <mach/fec.h> #include <types.h> #include <partition.h> -#include <mem_malloc.h> -#include <reloc.h> +#include <memory.h> +#include <sizes.h> +#include <linux/stat.h> +#include <fs.h> static struct mpc5xxx_fec_platform_data fec_info = { .xcv_type = MII100, @@ -43,14 +45,29 @@ static struct mpc5xxx_fec_platform_data fec_info = { static int devices_init (void) { - add_cfi_flash_device(-1, 0xff000000, 16 * 1024 * 1024, 0); - add_mem_device("ram0", 0x0, 64 * 1024 * 1024, - IORESOURCE_MEM_WRITEABLE); + unsigned long sdramsize; + struct stat s; + int ret; + + /* + * Flash can be 16MB or 32MB, setup for the last 32MB no matter + * what we find later. + */ + mpc5200_setup_cs(MPC5200_BOOTCS, 0xfe000000, SZ_32M, 0x0008fd00); + add_cfi_flash_device(-1, 0xfe000000, 32 * 1024 * 1024, 0); + + sdramsize = mpc5200_get_sdram_size(0) + mpc5200_get_sdram_size(1); + barebox_add_memory_bank("ram0", 0x0, sdramsize); + add_generic_device("fec_mpc5xxx", -1, NULL, MPC5XXX_FEC, 0, IORESOURCE_MEM, &fec_info); - devfs_add_partition("nor0", 0x00f00000, 0x40000, PARTITION_FIXED, "self0"); - devfs_add_partition("nor0", 0x00f60000, 0x20000, PARTITION_FIXED, "env0"); + ret = stat("/dev/nor0", &s); + if (ret) + return 0; + + devfs_add_partition("nor0", s.st_size - SZ_1M, SZ_512K, PARTITION_FIXED, "self0"); + devfs_add_partition("nor0", s.st_size - SZ_512K, SZ_512K, PARTITION_FIXED, "env0"); return 0; } @@ -68,15 +85,6 @@ static int console_init(void) console_initcall(console_init); -void *get_early_console_base(const char *name) -{ - if (!strcmp(name, RELOC("psc3"))) - return (void *)MPC5XXX_PSC3; - if (!strcmp(name, RELOC("psc6"))) - return (void *)MPC5XXX_PSC6; - return NULL; -} - #include "mt46v32m16-75.h" static void sdram_start (int hi_addr) @@ -118,20 +126,22 @@ static void sdram_start (int hi_addr) __asm__ volatile ("sync"); } -/* - * ATTENTION: Although partially referenced initdram does NOT make real use - * use of CFG_SDRAM_BASE. The code does not work if CFG_SDRAM_BASE - * is something else than 0x00000000. - */ - -long int initdram (int board_type) +void initdram (int board_type) { ulong dramsize = 0; - ulong dramsize2 = 0; ulong test1, test2; - if ((ulong)RELOC(initdram) > (2 << 30)) { + /* Setup pin multiplexing */ + + /* PSC6=UART, PSC3=UART ; Ether=100MBit with MD */ + *(vu_long *)MPC5XXX_GPS_PORT_CONFIG = 0x00558c10; + *(vu_long *)MPC5XXX_CS_BURST = 0x00000000; + *(vu_long *)MPC5XXX_CS_DEADCYCLE = 0x33333333; + + mpc5200_setup_bus_clocks(1, 4); + + if (get_pc() > SZ_128M) { /* setup SDRAM chip selects */ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001b;/* 256MB at 0x0 */ *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x10000000;/* disabled */ @@ -150,9 +160,9 @@ long int initdram (int board_type) /* find RAM size using SDRAM CS0 only */ sdram_start(0); - test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x10000000); + test1 = get_ram_size((ulong *)0, 0x10000000); sdram_start(1); - test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x10000000); + test2 = get_ram_size((ulong *)0, 0x10000000); if (test1 > test2) { sdram_start(0); dramsize = test1; @@ -171,26 +181,7 @@ long int initdram (int board_type) } else { *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */ } - } else - puts(RELOC("skipping sdram initialization\n")); - - /* retrieve size of memory connected to SDRAM CS0 */ - dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF; - if (dramsize >= 0x13) { - dramsize = (1 << (dramsize - 0x13)) << 20; - } else { - dramsize = 0; - } - - /* retrieve size of memory connected to SDRAM CS1 */ - dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF; - if (dramsize2 >= 0x13) { - dramsize2 = (1 << (dramsize2 - 0x13)) << 20; - } else { - dramsize2 = 0; } - - return dramsize + dramsize2; } #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) diff --git a/arch/ppc/include/asm/common.h b/arch/ppc/include/asm/common.h index 96de5c6568..b7c524a646 100644 --- a/arch/ppc/include/asm/common.h +++ b/arch/ppc/include/asm/common.h @@ -3,14 +3,10 @@ #include <asm/barebox.h> -void upmconfig (unsigned int, unsigned int *, unsigned int); -ulong get_tbclk (void); +extern unsigned long _text_base; unsigned long long get_ticks(void); -int get_clocks (void); -ulong get_bus_freq (ulong); - int cpu_init (void); uint get_pvr (void); @@ -21,4 +17,21 @@ void trap_init (ulong); int cpu_init_board_data(bd_t *bd); int init_board_data(bd_t *bd); +static inline unsigned long get_pc(void) +{ + unsigned long pc; + + __asm__ __volatile__( + " mflr 0\n" + " bl 1f\n" + "1:\n" + " mflr %0\n" + " mtlr 0\n" + : "=r" (pc) + : + : "0", "memory"); + + return pc; +} + #endif /* __ASM_COMMON_H */ diff --git a/arch/ppc/include/asm/mc146818rtc.h b/arch/ppc/include/asm/mc146818rtc.h index 5f806c4ec2..adc4e24db7 100644 --- a/arch/ppc/include/asm/mc146818rtc.h +++ b/arch/ppc/include/asm/mc146818rtc.h @@ -4,7 +4,7 @@ #ifndef __ASM_PPC_MC146818RTC_H #define __ASM_PPC_MC146818RTC_H -#include <asm/io.h> +#include <io.h> #ifndef RTC_PORT #define RTC_PORT(x) (0x70 + (x)) diff --git a/arch/ppc/lib/board.c b/arch/ppc/lib/board.c index 7f8118e16f..82ba458fcc 100644 --- a/arch/ppc/lib/board.c +++ b/arch/ppc/lib/board.c @@ -26,10 +26,9 @@ #include <watchdog.h> #include <command.h> #include <malloc.h> -#include <mem_malloc.h> +#include <memory.h> #include <init.h> #include <net.h> -#include <reloc.h> #include <asm-generic/memory_layout.h> /************************************************************************ @@ -48,8 +47,6 @@ void board_init_r (ulong end_of_ram) asm ("sync ; isync"); - _text_base += reloc_offset(); - /* * FIXME: 128k stack size. Is this enough? should * it be configurable? diff --git a/arch/ppc/lib/board_data.c b/arch/ppc/lib/board_data.c index b28830f792..ff9f0d0f0c 100644 --- a/arch/ppc/lib/board_data.c +++ b/arch/ppc/lib/board_data.c @@ -4,7 +4,7 @@ int init_board_data(bd_t *bd) { cpu_init_board_data(bd); - bd->bi_memstart = CFG_SDRAM_BASE; /* start of DRAM memory */ + bd->bi_memstart = 0; /* start of DRAM memory */ // bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */ /* FIXME */ #ifdef CONFIG_IP860 diff --git a/arch/ppc/mach-mpc5xxx/Kconfig b/arch/ppc/mach-mpc5xxx/Kconfig index 5da6a5b5b2..632fb857f1 100644 --- a/arch/ppc/mach-mpc5xxx/Kconfig +++ b/arch/ppc/mach-mpc5xxx/Kconfig @@ -10,6 +10,3 @@ config MACH_PHYCORE_MPC5200B_TINY_REV old board you should set this option to 1 endmenu - -config EARLY_CONSOLE_PORT - default "psc3" if MACH_PHYCORE_MPC5200B_TINY
\ No newline at end of file diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c index be7c19d136..d695b9b545 100644 --- a/arch/ppc/mach-mpc5xxx/cpu.c +++ b/arch/ppc/mach-mpc5xxx/cpu.c @@ -30,8 +30,10 @@ #include <mach/mpc5xxx.h> #include <asm/processor.h> #include <asm/byteorder.h> +#include <asm/io.h> #include <init.h> #include <types.h> +#include <errno.h> #include <mach/clocks.h> #if defined(CONFIG_OF_FLAT_TREE) @@ -41,16 +43,10 @@ int checkcpu (void) { ulong clock = get_cpu_clock(); -#ifndef CONFIG_MGT5100 uint svr, pvr; -#endif puts ("CPU: "); -#ifdef CONFIG_MGT5100 - puts (CPU_ID_STR); - printf (" (JTAG ID %08lx)", *(vu_long *)MPC5XXX_CDM_JTAGID); -#else svr = get_svr(); pvr = get_pvr(); switch (SVR_VER (svr)) { @@ -64,7 +60,6 @@ int checkcpu (void) printf (" v%d.%d, Core v%d.%d", SVR_MJREV (svr), SVR_MNREV (svr), PVR_MAJ(pvr), PVR_MIN(pvr)); -#endif printf (" at %ld Hz\n", clock); return 0; } @@ -120,3 +115,126 @@ int cpu_init_board_data(bd_t *bd) bd->bi_pcifreq = get_pci_clock(); return 0; } + +unsigned long mpc5200_get_sdram_size(unsigned int cs) +{ + unsigned long size; + + if (cs > 1) + return 0; + + /* retrieve size of memory connected to SDRAM CS0 */ + size = *(vu_long *)(MPC5XXX_SDRAM_CS0CFG + (cs * 4)) & 0xFF; + if (size >= 0x13) + size = (1 << (size - 0x13)) << 20; + else + size = 0; + + return size; +} + +int mpc5200_setup_bus_clocks(unsigned int ipbdiv, unsigned long pcidiv) +{ + u32 cdmcfg = *(vu_long *)MPC5XXX_CDM_CFG; + + cdmcfg &= ~0x103; + + switch (ipbdiv) { + case 1: + break; + case 2: + cdmcfg |= 0x100; + break; + default: + return -EINVAL; + } + + switch (pcidiv) { + case 1: + if (ipbdiv == 2) + return -EINVAL; + break; + case 2: + if (ipbdiv == 1) + cdmcfg |= 0x1; /* ipb / 2 */ + break; + case 4: + cdmcfg |= 0x2; /* xlb / 4 */ + break; + default: + return -EINVAL; + } + + *(vu_long *)MPC5XXX_CDM_CFG = cdmcfg; + + return 0; +} + +struct mpc5200_cs { + void *start; + void *stop; + void *cfg; + unsigned int addecr; +}; + +static struct mpc5200_cs chipselects[] = { + { + .start = (void *)MPC5XXX_CS0_START, + .stop = (void *)MPC5XXX_CS0_STOP, + .cfg = (void *)MPC5XXX_CS0_CFG, + .addecr = 1 << 16, + }, { + .start = (void *)MPC5XXX_CS1_START, + .stop = (void *)MPC5XXX_CS1_STOP, + .cfg = (void *)MPC5XXX_CS1_CFG, + .addecr = 1 << 17, + }, { + .start = (void *)MPC5XXX_CS2_START, + .stop = (void *)MPC5XXX_CS2_STOP, + .cfg = (void *)MPC5XXX_CS2_CFG, + .addecr = 1 << 18, + }, { + .start = (void *)MPC5XXX_CS3_START, + .stop = (void *)MPC5XXX_CS3_STOP, + .cfg = (void *)MPC5XXX_CS3_CFG, + .addecr = 1 << 19, + }, { + .start = (void *)MPC5XXX_CS4_START, + .stop = (void *)MPC5XXX_CS4_STOP, + .cfg = (void *)MPC5XXX_CS4_CFG, + .addecr = 1 << 20, + }, { + .start = (void *)MPC5XXX_CS5_START, + .stop = (void *)MPC5XXX_CS5_STOP, + .cfg = (void *)MPC5XXX_CS5_CFG, + .addecr = 1 << 21, + }, { + .start = (void *)MPC5XXX_CS6_START, + .stop = (void *)MPC5XXX_CS6_STOP, + .cfg = (void *)MPC5XXX_CS6_CFG, + .addecr = 1 << 26, + }, { + .start = (void *)MPC5XXX_CS7_START, + .stop = (void *)MPC5XXX_CS7_STOP, + .cfg = (void *)MPC5XXX_CS7_CFG, + .addecr = 1 << 27, + }, { + .start = (void *)MPC5XXX_BOOTCS_START, + .stop = (void *)MPC5XXX_BOOTCS_STOP, + .cfg = (void *)MPC5XXX_CS0_CFG, + .addecr = 1 << 25, + }, +}; + +void mpc5200_setup_cs(int cs, unsigned long start, unsigned long size, u32 cfg) +{ + u32 addecr; + + out_be32(chipselects[cs].start, START_REG(start)); + out_be32(chipselects[cs].stop, STOP_REG(start, size)); + out_be32(chipselects[cs].cfg, cfg); + + addecr = in_be32((void *)MPC5XXX_ADDECR); + addecr |= chipselects[cs].addecr | 1; + out_be32((void *)MPC5XXX_ADDECR, addecr); +} diff --git a/arch/ppc/mach-mpc5xxx/cpu_init.c b/arch/ppc/mach-mpc5xxx/cpu_init.c index fc5db0ec3e..a6c270b3ef 100644 --- a/arch/ppc/mach-mpc5xxx/cpu_init.c +++ b/arch/ppc/mach-mpc5xxx/cpu_init.c @@ -24,172 +24,35 @@ #include <common.h> #include <mach/mpc5xxx.h> #include <types.h> -#include <reloc.h> /* * Breath some life into the CPU... * - * Set up the memory map, * initialize a bunch of registers. */ int cpu_init(void) { unsigned long addecr = (1 << 25); /* Boot_CS */ -#if defined(CFG_RAMBOOT) && defined(CONFIG_MGT5100) - addecr |= (1 << 22); /* SDRAM enable */ -#endif - - /* - * Memory Controller: configure chip selects and enable them - */ -#if defined(CFG_BOOTCS_START) && defined(CFG_BOOTCS_SIZE) - *(vu_long *)MPC5XXX_BOOTCS_START = START_REG(CFG_BOOTCS_START); - *(vu_long *)MPC5XXX_BOOTCS_STOP = STOP_REG(CFG_BOOTCS_START, - CFG_BOOTCS_SIZE); -#endif -#if defined(CFG_BOOTCS_CFG) - *(vu_long *)MPC5XXX_BOOTCS_CFG = CFG_BOOTCS_CFG; -#endif - -#if defined(CFG_CS0_START) && defined(CFG_CS0_SIZE) - *(vu_long *)MPC5XXX_CS0_START = START_REG(CFG_CS0_START); - *(vu_long *)MPC5XXX_CS0_STOP = STOP_REG(CFG_CS0_START, CFG_CS0_SIZE); - /* CS0 and BOOT_CS cannot be enabled at once. */ - /* addecr |= (1 << 16); */ -#endif -#if defined(CFG_CS0_CFG) - *(vu_long *)MPC5XXX_CS0_CFG = CFG_CS0_CFG; -#endif - -#if defined(CFG_CS1_START) && defined(CFG_CS1_SIZE) - *(vu_long *)MPC5XXX_CS1_START = START_REG(CFG_CS1_START); - *(vu_long *)MPC5XXX_CS1_STOP = STOP_REG(CFG_CS1_START, CFG_CS1_SIZE); - addecr |= (1 << 17); -#endif -#if defined(CFG_CS1_CFG) - *(vu_long *)MPC5XXX_CS1_CFG = CFG_CS1_CFG; -#endif - -#if defined(CFG_CS2_START) && defined(CFG_CS2_SIZE) - *(vu_long *)MPC5XXX_CS2_START = START_REG(CFG_CS2_START); - *(vu_long *)MPC5XXX_CS2_STOP = STOP_REG(CFG_CS2_START, CFG_CS2_SIZE); - addecr |= (1 << 18); -#endif -#if defined(CFG_CS2_CFG) - *(vu_long *)MPC5XXX_CS2_CFG = CFG_CS2_CFG; -#endif - -#if defined(CFG_CS3_START) && defined(CFG_CS3_SIZE) - *(vu_long *)MPC5XXX_CS3_START = START_REG(CFG_CS3_START); - *(vu_long *)MPC5XXX_CS3_STOP = STOP_REG(CFG_CS3_START, CFG_CS3_SIZE); - addecr |= (1 << 19); -#endif -#if defined(CFG_CS3_CFG) - *(vu_long *)MPC5XXX_CS3_CFG = CFG_CS3_CFG; -#endif - -#if defined(CFG_CS4_START) && defined(CFG_CS4_SIZE) - *(vu_long *)MPC5XXX_CS4_START = START_REG(CFG_CS4_START); - *(vu_long *)MPC5XXX_CS4_STOP = STOP_REG(CFG_CS4_START, CFG_CS4_SIZE); - addecr |= (1 << 20); -#endif -#if defined(CFG_CS4_CFG) - *(vu_long *)MPC5XXX_CS4_CFG = CFG_CS4_CFG; -#endif - -#if defined(CFG_CS5_START) && defined(CFG_CS5_SIZE) - *(vu_long *)MPC5XXX_CS5_START = START_REG(CFG_CS5_START); - *(vu_long *)MPC5XXX_CS5_STOP = STOP_REG(CFG_CS5_START, CFG_CS5_SIZE); - addecr |= (1 << 21); -#endif -#if defined(CFG_CS5_CFG) - *(vu_long *)MPC5XXX_CS5_CFG = CFG_CS5_CFG; -#endif - -#if defined(CONFIG_MPC5200) - addecr |= 1; -#if defined(CFG_CS6_START) && defined(CFG_CS6_SIZE) - *(vu_long *)MPC5XXX_CS6_START = START_REG(CFG_CS6_START); - *(vu_long *)MPC5XXX_CS6_STOP = STOP_REG(CFG_CS6_START, CFG_CS6_SIZE); - addecr |= (1 << 26); -#endif -#if defined(CFG_CS6_CFG) - *(vu_long *)MPC5XXX_CS6_CFG = CFG_CS6_CFG; -#endif - -#if defined(CFG_CS7_START) && defined(CFG_CS7_SIZE) - *(vu_long *)MPC5XXX_CS7_START = START_REG(CFG_CS5_START); - *(vu_long *)MPC5XXX_CS7_STOP = STOP_REG(CFG_CS7_START, CFG_CS7_SIZE); - addecr |= (1 << 27); -#endif -#if defined(CFG_CS7_CFG) - *(vu_long *)MPC5XXX_CS7_CFG = CFG_CS7_CFG; -#endif - -#if defined(CFG_CS_BURST) - *(vu_long *)MPC5XXX_CS_BURST = CFG_CS_BURST; -#endif -#if defined(CFG_CS_DEADCYCLE) - *(vu_long *)MPC5XXX_CS_DEADCYCLE = CFG_CS_DEADCYCLE; -#endif -#endif /* CONFIG_MPC5200 */ - - /* Enable chip selects */ - *(vu_long *)MPC5XXX_ADDECR = addecr; - *(vu_long *)MPC5XXX_CS_CTRL = (1 << 24); - - /* Setup pin multiplexing */ -#if defined(CFG_GPS_PORT_CONFIG) - *(vu_long *)MPC5XXX_GPS_PORT_CONFIG = CFG_GPS_PORT_CONFIG; -#endif - -#if defined(CONFIG_MPC5200) /* enable timebase */ *(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 13); /* Enable snooping for RAM */ *(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 15); - *(vu_long *)(MPC5XXX_XLBARB + 0x70) = CFG_SDRAM_BASE | 0x1d; + *(vu_long *)(MPC5XXX_XLBARB + 0x70) = 0 | 0x1d; -# if defined(CFG_IPBSPEED_133) - /* Motorola reports IPB should better run at 133 MHz. */ - *(vu_long *)MPC5XXX_ADDECR |= 1; - /* pci_clk_sel = 0x02, ipb_clk_sel = 0x00; */ - addecr = *(vu_long *)MPC5XXX_CDM_CFG; - addecr &= ~0x103; -# if defined(CFG_PCISPEED_66) - /* pci_clk_sel = 0x01 -> IPB_CLK/2 */ - addecr |= 0x01; -# else - /* pci_clk_sel = 0x02 -> XLB_CLK/4 = IPB_CLK/4 */ - addecr |= 0x02; -# endif /* CFG_PCISPEED_66 */ - *(vu_long *)MPC5XXX_CDM_CFG = addecr; -# endif /* CFG_IPBSPEED_133 */ /* Configure the XLB Arbiter */ *(vu_long *)MPC5XXX_XLBARB_MPRIEN = 0xff; *(vu_long *)MPC5XXX_XLBARB_MPRIVAL = 0x11111111; -# if defined(CFG_XLB_PIPELINING) - /* Enable piplining */ - *(vu_long *)(MPC5XXX_XLBARB + 0x40) &= ~(1 << 31); -# endif -#endif /* CONFIG_MPC5200 */ - /* mask all interrupts */ -#if defined(CONFIG_MGT5100) - *(vu_long *)MPC5XXX_ICTL_PER_MASK = 0xfffffc00; -#elif defined(CONFIG_MPC5200) *(vu_long *)MPC5XXX_ICTL_PER_MASK = 0xffffff00; -#endif + *(vu_long *)MPC5XXX_ICTL_CRIT |= 0x0001ffff; *(vu_long *)MPC5XXX_ICTL_EXT &= ~0x00000f00; /* route critical ints to normal ints */ *(vu_long *)MPC5XXX_ICTL_EXT |= 0x00000001; - early_init(); - return 0; } diff --git a/arch/ppc/mach-mpc5xxx/include/mach/mpc5xxx.h b/arch/ppc/mach-mpc5xxx/include/mach/mpc5xxx.h index d7d081137b..cef02d8b18 100644 --- a/arch/ppc/mach-mpc5xxx/include/mach/mpc5xxx.h +++ b/arch/ppc/mach-mpc5xxx/include/mach/mpc5xxx.h @@ -40,6 +40,8 @@ /* Exception offsets (PowerPC standard) */ #define EXC_OFF_SYS_RESET 0x0100 +#define CFG_MBAR 0xf0000000 + /* useful macros for manipulating CSx_START/STOP */ #if defined(CONFIG_MGT5100) #define START_REG(start) ((start) >> 15) @@ -779,6 +781,16 @@ struct mpc5xxx_mscan { /* function prototypes */ void loadtask(int basetask, int tasks); +/* retrieve configured sdram size connected to a chipselect */ +unsigned long mpc5200_get_sdram_size(unsigned int cs); + +/* configure a local plus bus chip select */ +#define MPC5200_BOOTCS 8 +void mpc5200_setup_cs(int cs, unsigned long start, unsigned long size, u32 cfg); + +/* configure bus speeds. Both dividers are relative to xlb clock */ +int mpc5200_setup_bus_clocks(unsigned int ipbdiv, unsigned long pcidiv); + #endif /* __ASSEMBLY__ */ #endif /* __ASMPPC_MPC5XXX_H */ diff --git a/arch/ppc/mach-mpc5xxx/interrupts.c b/arch/ppc/mach-mpc5xxx/interrupts.c index e484b6ecde..4838bc5f70 100644 --- a/arch/ppc/mach-mpc5xxx/interrupts.c +++ b/arch/ppc/mach-mpc5xxx/interrupts.c @@ -39,7 +39,7 @@ #include <common.h> #include <asm/processor.h> -#include <asm/io.h> +#include <io.h> #include <command.h> #include <mach/sdma.h> #include <asm/bitops.h> diff --git a/arch/ppc/mach-mpc5xxx/pci_mpc5200.c b/arch/ppc/mach-mpc5xxx/pci_mpc5200.c index a7de4a2268..d8f3b00759 100644 --- a/arch/ppc/mach-mpc5xxx/pci_mpc5200.c +++ b/arch/ppc/mach-mpc5xxx/pci_mpc5200.c @@ -26,7 +26,7 @@ #if defined(CONFIG_PCI) && defined(CONFIG_MPC5200) #include <asm/processor.h> -#include <asm/io.h> +#include <io.h> #include <pci.h> #include <mpc5xxx.h> diff --git a/arch/ppc/mach-mpc5xxx/start.S b/arch/ppc/mach-mpc5xxx/start.S index 8fca31b7a6..dc53c8a226 100644 --- a/arch/ppc/mach-mpc5xxx/start.S +++ b/arch/ppc/mach-mpc5xxx/start.S @@ -66,76 +66,32 @@ * Exception vectors */ .text + /* + * Second stage loader entry. When entered here we assume that spr 311 + * is set to the current MBAR address. + */ + mfspr r4, MBAR + b setup_mbar . = EXC_OFF_SYS_RESET .globl _start _start: - li r21, BOOTFLAG_COLD /* Normal Power-On */ - nop - b boot_cold - - . = EXC_OFF_SYS_RESET + 0x10 - - .globl _start_warm -_start_warm: - li r21, BOOTFLAG_WARM /* Software reboot */ - b boot_warm + /* + * Reset entry. When entered here we assume that MBAR is at reset default + * 0x80000000. + */ + lis r4, 0x80000000@h + ori r4, r4, 0x80000000@l -boot_cold: -boot_warm: +setup_mbar: + /* r4 == current MBAR */ mfmsr r5 /* save msr contents */ - /* Move CSBoot and adjust instruction pointer */ - /*--------------------------------------------------------------*/ - -#if defined(CFG_LOWBOOT) -# if defined(CFG_RAMBOOT) -# error CFG_LOWBOOT is incompatible with CFG_RAMBOOT -# endif /* CFG_RAMBOOT */ -# if defined(CONFIG_MGT5100) -# error CFG_LOWBOOT is incompatible with MGT5100 -# endif /* CONFIG_MGT5100 */ - lis r4, CFG_DEFAULT_MBAR@h - lis r3, START_REG(CFG_BOOTCS_START)@h - ori r3, r3, START_REG(CFG_BOOTCS_START)@l - stw r3, 0x4(r4) /* CS0 start */ - lis r3, STOP_REG(CFG_BOOTCS_START, CFG_BOOTCS_SIZE)@h - ori r3, r3, STOP_REG(CFG_BOOTCS_START, CFG_BOOTCS_SIZE)@l - stw r3, 0x8(r4) /* CS0 stop */ - lis r3, 0x02010000@h - ori r3, r3, 0x02010000@l - stw r3, 0x54(r4) /* CS0 and Boot enable */ - - lis r3, lowboot_reentry@h /* jump from bootlow address space (0x0000xxxx) */ - ori r3, r3, lowboot_reentry@l /* to the address space the linker used */ - mtlr r3 - blr - -lowboot_reentry: - lis r3, START_REG(CFG_BOOTCS_START)@h - ori r3, r3, START_REG(CFG_BOOTCS_START)@l - stw r3, 0x4c(r4) /* Boot start */ - lis r3, STOP_REG(CFG_BOOTCS_START, CFG_BOOTCS_SIZE)@h - ori r3, r3, STOP_REG(CFG_BOOTCS_START, CFG_BOOTCS_SIZE)@l - stw r3, 0x50(r4) /* Boot stop */ - lis r3, 0x02000001@h - ori r3, r3, 0x02000001@l - stw r3, 0x54(r4) /* Boot enable, CS0 disable */ -#endif /* CFG_LOWBOOT */ - -#if defined(CFG_DEFAULT_MBAR) && !defined(CFG_RAMBOOT) - lis r3, CFG_MBAR@h - ori r3, r3, CFG_MBAR@l -#if defined(CONFIG_MPC5200) - /* MBAR is mirrored into the MBAR SPR */ - mtspr MBAR,r3 + /* Switch MBAR to 0xf0000000 */ + lis r3, 0xf0000000@h + ori r3, r3, 0xf0000000@l + mtspr MBAR, r3 rlwinm r3, r3, 16, 16, 31 -#endif -#if defined(CONFIG_MGT5100) - rlwinm r3, r3, 17, 15, 31 -#endif - lis r4, CFG_DEFAULT_MBAR@h stw r3, 0(r4) -#endif /* CFG_DEFAULT_MBAR */ /* Initialise the MPC5xxx processor core */ /*--------------------------------------------------------------*/ @@ -146,9 +102,8 @@ lowboot_reentry: /*--------------------------------------------------------------*/ /* set up stack in on-chip SRAM */ - lis r3, (CFG_INIT_RAM_ADDR + CFG_INIT_RAM_SIZE)@h - ori r3, r3, (CFG_INIT_RAM_ADDR + CFG_INIT_RAM_SIZE)@l - subi r1, r3, CONFIG_EARLY_INITDATA_SIZE + lis r1, (MPC5XXX_SRAM + MPC5XXX_SRAM_SIZE)@h + ori r1, r1, (MPC5XXX_SRAM + MPC5XXX_SRAM_SIZE)@l li r0, 0 /* Make room for stack frame header and */ stwu r0, -4(r1) /* clear final stack frame so that */ stwu r0, -4(r1) /* stack backtraces terminate cleanly */ @@ -809,21 +764,6 @@ trap_reloc: blr - .globl reloc_offset -reloc_offset: - mfspr r4, LR - bl pc -pc: - mfspr r3, LR - mtspr LR, r4 - addi r4, r3, (_text_base - pc) - subi r3, r3, (pc - _start) - lwz r4, 0(r4) - - sub r3, r3, r4 - subi r3, r3, 0x100 - blr - .globl _text_base _text_base: .long TEXT_BASE diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c index 4b61d91930..ddb40ee5c2 100644 --- a/arch/x86/boot/a20.c +++ b/arch/x86/boot/a20.c @@ -14,7 +14,7 @@ */ #include <asm/segment.h> -#include <asm/io.h> +#include <io.h> #include "boot.h" #define MAX_8042_LOOPS 100000 diff --git a/arch/x86/boot/prepare_uboot.c b/arch/x86/boot/prepare_uboot.c index a68aceddb6..79e6fb0cbe 100644 --- a/arch/x86/boot/prepare_uboot.c +++ b/arch/x86/boot/prepare_uboot.c @@ -13,7 +13,7 @@ */ #include <asm/segment.h> #include <asm/modes.h> -#include <asm/io.h> +#include <io.h> #include "boot.h" /* be aware of: */ diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 27ea642527..9cb78e41ec 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -10,6 +10,8 @@ #ifndef __ASM_X86_IO_H #define __ASM_X86_IO_H +#include <asm/byteorder.h> + static inline void outb(unsigned char value, int port) { asm volatile("outb %b0, %w1" : : "a"(value), "Nd"(port)); diff --git a/arch/x86/lib/memory.c b/arch/x86/lib/memory.c index 9496d2277f..fa7bc03962 100644 --- a/arch/x86/lib/memory.c +++ b/arch/x86/lib/memory.c @@ -27,7 +27,7 @@ #include <init.h> #include <stdio.h> -#include <mem_malloc.h> +#include <memory.h> #include <asm/syslib.h> #include <asm-generic/memory_layout.h> diff --git a/arch/x86/mach-i386/generic.c b/arch/x86/mach-i386/generic.c index edeacc4275..376de58964 100644 --- a/arch/x86/mach-i386/generic.c +++ b/arch/x86/mach-i386/generic.c @@ -23,7 +23,7 @@ * @brief x86 Architecture Initialization routines */ -#include <asm/io.h> +#include <io.h> /** to work with the 8250 UART driver implementation we need this function */ unsigned int x86_uart_read(unsigned long base, unsigned char reg_idx) diff --git a/arch/x86/mach-i386/pit_timer.c b/arch/x86/mach-i386/pit_timer.c index ec97cee49b..36019b0ede 100644 --- a/arch/x86/mach-i386/pit_timer.c +++ b/arch/x86/mach-i386/pit_timer.c @@ -32,7 +32,7 @@ #include <init.h> #include <clock.h> -#include <asm/io.h> +#include <io.h> /** base address of the PIT in a standard PC */ #define PIT 0x40 |