Loading arch/arm/kernel/smp_scu.c +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ void __init scu_enable(void __iomem *scu_base) u32 scu_ctrl; scu_ctrl = __raw_readl(scu_base + SCU_CTRL); /* already enabled? */ if (scu_ctrl & 1) return; scu_ctrl |= 1; __raw_writel(scu_ctrl, scu_base + SCU_CTRL); Loading arch/arm/mach-realview/Kconfig +4 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ config MACH_REALVIEW_PBX bool "Support RealView/PBX platform" select ARM_GIC select HAVE_PATA_PLATFORM select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !HIGH_PHYS_OFFSET select ZONE_DMA if SPARSEMEM help Include support for the ARM(R) RealView PBX platform. Loading @@ -82,6 +84,7 @@ config REALVIEW_HIGH_PHYS_OFFSET 0x70000000, 256MB of which being mirrored at 0x00000000. If the board supports 512MB of RAM, this option allows the memory to be accessed contiguously at the high physical offset. offset. On the PBX board, disabling this option allows 1GB of RAM to be used with SPARSEMEM. endmenu arch/arm/mach-realview/core.c +41 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,25 @@ /* used by entry-macro.S and platsmp.c */ void __iomem *gic_cpu_base_addr; #ifdef CONFIG_ZONE_DMA /* * Adjust the zones if there are restrictions for DMA access. */ void __init realview_adjust_zones(int node, unsigned long *size, unsigned long *hole) { unsigned long dma_size = SZ_256M >> PAGE_SHIFT; if (!machine_is_realview_pbx() || node || (size[0] <= dma_size)) return; size[ZONE_NORMAL] = size[0] - dma_size; size[ZONE_DMA] = dma_size; hole[ZONE_NORMAL] = hole[0]; hole[ZONE_DMA] = 0; } #endif /* * This is the RealView sched_clock implementation. This has * a resolution of 41.7ns, and a maximum value of about 179s. Loading Loading @@ -543,7 +562,7 @@ static int realview_clcd_setup(struct clcd_fb *fb) fb->panel = realview_clcd_panel(); fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, &dma, GFP_KERNEL); &dma, GFP_KERNEL | GFP_DMA); if (!fb->fb.screen_base) { printk(KERN_ERR "CLCD: unable to map framebuffer\n"); return -ENOMEM; Loading Loading @@ -788,3 +807,24 @@ void __init realview_timer_init(unsigned int timer_irq) realview_clocksource_init(); realview_clockevents_init(timer_irq); } /* * Setup the memory banks. */ void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from, struct meminfo *meminfo) { /* * Most RealView platforms have 512MB contiguous RAM at 0x70000000. * Half of this is mirrored at 0. */ #ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET meminfo->bank[0].start = 0x70000000; meminfo->bank[0].size = SZ_512M; meminfo->nr_banks = 1; #else meminfo->bank[0].start = 0; meminfo->bank[0].size = SZ_256M; meminfo->nr_banks = 1; #endif } arch/arm/mach-realview/core.h +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <linux/amba/bus.h> #include <linux/io.h> #include <asm/setup.h> #include <asm/leds.h> #define AMBA_DEVICE(name,busid,base,plat) \ Loading @@ -44,6 +45,8 @@ static struct amba_device name##_device = { \ /* .dma = base##_DMA,*/ \ } struct machine_desc; extern struct platform_device realview_flash_device; extern struct platform_device realview_cf_device; extern struct platform_device realview_i2c_device; Loading @@ -61,5 +64,8 @@ extern void realview_timer_init(unsigned int timer_irq); extern int realview_flash_register(struct resource *res, u32 num); extern int realview_eth_register(const char *name, struct resource *res); extern int realview_usb_register(struct resource *res); extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from, struct meminfo *meminfo); extern void (*realview_reset)(char); #endif arch/arm/mach-realview/include/mach/memory.h +49 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,53 @@ #define PHYS_OFFSET UL(0x00000000) #endif #if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) extern void realview_adjust_zones(int node, unsigned long *size, unsigned long *hole); #define arch_adjust_zones(node, size, hole) \ realview_adjust_zones(node, size, hole) #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M) #endif #ifdef CONFIG_SPARSEMEM /* * Sparsemem definitions for RealView PBX. * * The RealView PBX board has another block of 512MB of RAM at 0x20000000, * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000) * may be used for DMA. * * The macros below define a section size of 256MB and a non-linear virtual to * physical mapping: * * 256MB @ 0x00000000 -> PAGE_OFFSET * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000 * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000 */ #ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET #error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET" #endif #define MAX_PHYSMEM_BITS 32 #define SECTION_SIZE_BITS 28 /* bank page offsets */ #define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) #define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) #define __phys_to_virt(phys) \ ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ (phys) + PAGE_OFFSET) #define __virt_to_phys(virt) \ ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \ (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \ (virt) - PAGE_OFFSET) #endif /* CONFIG_SPARSEMEM */ #endif Loading
arch/arm/kernel/smp_scu.c +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ void __init scu_enable(void __iomem *scu_base) u32 scu_ctrl; scu_ctrl = __raw_readl(scu_base + SCU_CTRL); /* already enabled? */ if (scu_ctrl & 1) return; scu_ctrl |= 1; __raw_writel(scu_ctrl, scu_base + SCU_CTRL); Loading
arch/arm/mach-realview/Kconfig +4 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ config MACH_REALVIEW_PBX bool "Support RealView/PBX platform" select ARM_GIC select HAVE_PATA_PLATFORM select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !HIGH_PHYS_OFFSET select ZONE_DMA if SPARSEMEM help Include support for the ARM(R) RealView PBX platform. Loading @@ -82,6 +84,7 @@ config REALVIEW_HIGH_PHYS_OFFSET 0x70000000, 256MB of which being mirrored at 0x00000000. If the board supports 512MB of RAM, this option allows the memory to be accessed contiguously at the high physical offset. offset. On the PBX board, disabling this option allows 1GB of RAM to be used with SPARSEMEM. endmenu
arch/arm/mach-realview/core.c +41 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,25 @@ /* used by entry-macro.S and platsmp.c */ void __iomem *gic_cpu_base_addr; #ifdef CONFIG_ZONE_DMA /* * Adjust the zones if there are restrictions for DMA access. */ void __init realview_adjust_zones(int node, unsigned long *size, unsigned long *hole) { unsigned long dma_size = SZ_256M >> PAGE_SHIFT; if (!machine_is_realview_pbx() || node || (size[0] <= dma_size)) return; size[ZONE_NORMAL] = size[0] - dma_size; size[ZONE_DMA] = dma_size; hole[ZONE_NORMAL] = hole[0]; hole[ZONE_DMA] = 0; } #endif /* * This is the RealView sched_clock implementation. This has * a resolution of 41.7ns, and a maximum value of about 179s. Loading Loading @@ -543,7 +562,7 @@ static int realview_clcd_setup(struct clcd_fb *fb) fb->panel = realview_clcd_panel(); fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, &dma, GFP_KERNEL); &dma, GFP_KERNEL | GFP_DMA); if (!fb->fb.screen_base) { printk(KERN_ERR "CLCD: unable to map framebuffer\n"); return -ENOMEM; Loading Loading @@ -788,3 +807,24 @@ void __init realview_timer_init(unsigned int timer_irq) realview_clocksource_init(); realview_clockevents_init(timer_irq); } /* * Setup the memory banks. */ void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from, struct meminfo *meminfo) { /* * Most RealView platforms have 512MB contiguous RAM at 0x70000000. * Half of this is mirrored at 0. */ #ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET meminfo->bank[0].start = 0x70000000; meminfo->bank[0].size = SZ_512M; meminfo->nr_banks = 1; #else meminfo->bank[0].start = 0; meminfo->bank[0].size = SZ_256M; meminfo->nr_banks = 1; #endif }
arch/arm/mach-realview/core.h +6 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <linux/amba/bus.h> #include <linux/io.h> #include <asm/setup.h> #include <asm/leds.h> #define AMBA_DEVICE(name,busid,base,plat) \ Loading @@ -44,6 +45,8 @@ static struct amba_device name##_device = { \ /* .dma = base##_DMA,*/ \ } struct machine_desc; extern struct platform_device realview_flash_device; extern struct platform_device realview_cf_device; extern struct platform_device realview_i2c_device; Loading @@ -61,5 +64,8 @@ extern void realview_timer_init(unsigned int timer_irq); extern int realview_flash_register(struct resource *res, u32 num); extern int realview_eth_register(const char *name, struct resource *res); extern int realview_usb_register(struct resource *res); extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from, struct meminfo *meminfo); extern void (*realview_reset)(char); #endif
arch/arm/mach-realview/include/mach/memory.h +49 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,53 @@ #define PHYS_OFFSET UL(0x00000000) #endif #if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) extern void realview_adjust_zones(int node, unsigned long *size, unsigned long *hole); #define arch_adjust_zones(node, size, hole) \ realview_adjust_zones(node, size, hole) #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M) #endif #ifdef CONFIG_SPARSEMEM /* * Sparsemem definitions for RealView PBX. * * The RealView PBX board has another block of 512MB of RAM at 0x20000000, * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000) * may be used for DMA. * * The macros below define a section size of 256MB and a non-linear virtual to * physical mapping: * * 256MB @ 0x00000000 -> PAGE_OFFSET * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000 * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000 */ #ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET #error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET" #endif #define MAX_PHYSMEM_BITS 32 #define SECTION_SIZE_BITS 28 /* bank page offsets */ #define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) #define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) #define __phys_to_virt(phys) \ ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ (phys) + PAGE_OFFSET) #define __virt_to_phys(virt) \ ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \ (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \ (virt) - PAGE_OFFSET) #endif /* CONFIG_SPARSEMEM */ #endif