Commit 5b3fcfed authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fixes' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm

* 'fixes' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm:
  ARM: sa11x0: assabet: fix build warning
  ARM: Add arm_memblock_steal() to allocate memory away from the kernel
  ARM: 7275/1: LPAE: Check the CPU support for the long descriptor format
  ARM: 7274/1: NUC900: Rename nuc900-audio platform device to nuc900-ac97
  ARM: 7272/1: S3C24XX: Fix build error for missing <mach/system-reset.h>
  ARM: 7271/1: Fix typo in conversion of ARCH_NR_GPIOS to Kconfig
parents a12587b0 a61c2332
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _ARCH_ARM_GPIO_H #define _ARCH_ARM_GPIO_H
#if CONFIG_ARCH_NR_GPIO > 0 #if CONFIG_ARCH_NR_GPIO > 0
#define ARCH_NR_GPIO CONFIG_ARCH_NR_GPIO #define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
#endif #endif
/* not all ARM platforms necessarily support this API ... */ /* not all ARM platforms necessarily support this API ... */
......
...@@ -6,4 +6,6 @@ struct machine_desc; ...@@ -6,4 +6,6 @@ struct machine_desc;
extern void arm_memblock_init(struct meminfo *, struct machine_desc *); extern void arm_memblock_init(struct meminfo *, struct machine_desc *);
phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);
#endif #endif
...@@ -99,6 +99,14 @@ ENTRY(stext) ...@@ -99,6 +99,14 @@ ENTRY(stext)
THUMB( it eq ) @ force fixup-able long branch encoding THUMB( it eq ) @ force fixup-able long branch encoding
beq __error_p @ yes, error 'p' beq __error_p @ yes, error 'p'
#ifdef CONFIG_ARM_LPAE
mrc p15, 0, r3, c0, c1, 4 @ read ID_MMFR0
and r3, r3, #0xf @ extract VMSA support
cmp r3, #5 @ long-descriptor translation table format?
THUMB( it lo ) @ force fixup-able long branch encoding
blo __error_p @ only classic page table format
#endif
#ifndef CONFIG_XIP_KERNEL #ifndef CONFIG_XIP_KERNEL
adr r3, 2f adr r3, 2f
ldmia r3, {r4, r8} ldmia r3, {r4, r8}
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/iomux-mx3.h> #include <mach/iomux-mx3.h>
#include <mach/3ds_debugboard.h> #include <mach/3ds_debugboard.h>
...@@ -754,10 +755,8 @@ static struct sys_timer mx31_3ds_timer = { ...@@ -754,10 +755,8 @@ static struct sys_timer mx31_3ds_timer = {
static void __init mx31_3ds_reserve(void) static void __init mx31_3ds_reserve(void)
{ {
/* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
mx3_camera_base = memblock_alloc(MX31_3DS_CAMERA_BUF_SIZE, mx3_camera_base = arm_memblock_steal(MX31_3DS_CAMERA_BUF_SIZE,
MX31_3DS_CAMERA_BUF_SIZE); MX31_3DS_CAMERA_BUF_SIZE);
memblock_free(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE);
memblock_remove(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE);
} }
MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/board-mx31moboard.h> #include <mach/board-mx31moboard.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/hardware.h> #include <mach/hardware.h>
...@@ -584,10 +585,8 @@ struct sys_timer mx31moboard_timer = { ...@@ -584,10 +585,8 @@ struct sys_timer mx31moboard_timer = {
static void __init mx31moboard_reserve(void) static void __init mx31moboard_reserve(void)
{ {
/* reserve 4 MiB for mx3-camera */ /* reserve 4 MiB for mx3-camera */
mx3_camera_base = memblock_alloc(MX3_CAMERA_BUF_SIZE, mx3_camera_base = arm_memblock_steal(MX3_CAMERA_BUF_SIZE,
MX3_CAMERA_BUF_SIZE); MX3_CAMERA_BUF_SIZE);
memblock_free(mx3_camera_base, MX3_CAMERA_BUF_SIZE);
memblock_remove(mx3_camera_base, MX3_CAMERA_BUF_SIZE);
} }
MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/iomux-mx3.h> #include <mach/iomux-mx3.h>
...@@ -680,10 +681,8 @@ struct sys_timer pcm037_timer = { ...@@ -680,10 +681,8 @@ struct sys_timer pcm037_timer = {
static void __init pcm037_reserve(void) static void __init pcm037_reserve(void)
{ {
/* reserve 4 MiB for mx3-camera */ /* reserve 4 MiB for mx3-camera */
mx3_camera_base = memblock_alloc(MX3_CAMERA_BUF_SIZE, mx3_camera_base = arm_memblock_steal(MX3_CAMERA_BUF_SIZE,
MX3_CAMERA_BUF_SIZE); MX3_CAMERA_BUF_SIZE);
memblock_free(mx3_camera_base, MX3_CAMERA_BUF_SIZE);
memblock_remove(mx3_camera_base, MX3_CAMERA_BUF_SIZE);
} }
MACHINE_START(PCM037, "Phytec Phycore pcm037") MACHINE_START(PCM037, "Phytec Phycore pcm037")
......
...@@ -366,8 +366,8 @@ config OMAP3_SDRC_AC_TIMING ...@@ -366,8 +366,8 @@ config OMAP3_SDRC_AC_TIMING
going on could result in system crashes; going on could result in system crashes;
config OMAP4_ERRATA_I688 config OMAP4_ERRATA_I688
bool "OMAP4 errata: Async Bridge Corruption" bool "OMAP4 errata: Async Bridge Corruption (BROKEN)"
depends on ARCH_OMAP4 depends on ARCH_OMAP4 && BROKEN
select ARCH_HAS_BARRIERS select ARCH_HAS_BARRIERS
help help
If a data is stalled inside asynchronous bridge because of back If a data is stalled inside asynchronous bridge because of back
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/memblock.h> #include <linux/memblock.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/memblock.h>
#include <mach/omap-secure.h> #include <mach/omap-secure.h>
...@@ -57,20 +58,10 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2, ...@@ -57,20 +58,10 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
/* Allocate the memory to save secure ram */ /* Allocate the memory to save secure ram */
int __init omap_secure_ram_reserve_memblock(void) int __init omap_secure_ram_reserve_memblock(void)
{ {
phys_addr_t paddr;
u32 size = OMAP_SECURE_RAM_STORAGE; u32 size = OMAP_SECURE_RAM_STORAGE;
size = ALIGN(size, SZ_1M); size = ALIGN(size, SZ_1M);
paddr = memblock_alloc(size, SZ_1M); omap_secure_memblock_base = arm_memblock_steal(size, SZ_1M);
if (!paddr) {
pr_err("%s: failed to reserve %x bytes\n",
__func__, size);
return -ENOMEM;
}
memblock_free(paddr, size);
memblock_remove(paddr, size);
omap_secure_memblock_base = paddr;
return 0; return 0;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <asm/hardware/gic.h> #include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/hardware/cache-l2x0.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h>
#include <plat/irqs.h> #include <plat/irqs.h>
#include <plat/sram.h> #include <plat/sram.h>
...@@ -61,13 +62,8 @@ static int __init omap_barriers_init(void) ...@@ -61,13 +62,8 @@ static int __init omap_barriers_init(void)
return -ENODEV; return -ENODEV;
size = ALIGN(PAGE_SIZE, SZ_1M); size = ALIGN(PAGE_SIZE, SZ_1M);
paddr = memblock_alloc(size, SZ_1M); paddr = arm_memblock_steal(size, SZ_1M);
if (!paddr) {
pr_err("%s: failed to reserve 4 Kbytes\n", __func__);
return -ENOMEM;
}
memblock_free(paddr, size);
memblock_remove(paddr, size);
dram_io_desc[0].virtual = OMAP4_DRAM_BARRIER_VA; dram_io_desc[0].virtual = OMAP4_DRAM_BARRIER_VA;
dram_io_desc[0].pfn = __phys_to_pfn(paddr); dram_io_desc[0].pfn = __phys_to_pfn(paddr);
dram_io_desc[0].length = size; dram_io_desc[0].length = size;
......
...@@ -280,7 +280,7 @@ static void __init map_sa1100_gpio_regs( void ) ...@@ -280,7 +280,7 @@ static void __init map_sa1100_gpio_regs( void )
int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO); int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
pmd_t *pmd; pmd_t *pmd;
pmd = pmd_offset(pgd_offset_k(virt), virt); pmd = pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
*pmd = __pmd(phys | prot); *pmd = __pmd(phys | prot);
flush_pmd_entry(pmd); flush_pmd_entry(pmd);
} }
......
...@@ -48,7 +48,7 @@ static void clock_source_select(const char *dev_id, unsigned int clkval) ...@@ -48,7 +48,7 @@ static void clock_source_select(const char *dev_id, unsigned int clkval)
offset = ATAOFFSET; offset = ATAOFFSET;
else if (strcmp(dev_id, "nuc900-lcd") == 0) else if (strcmp(dev_id, "nuc900-lcd") == 0)
offset = LCDOFFSET; offset = LCDOFFSET;
else if (strcmp(dev_id, "nuc900-audio") == 0) else if (strcmp(dev_id, "nuc900-ac97") == 0)
offset = AUDOFFSET; offset = AUDOFFSET;
else else
offset = CPUOFFSET; offset = CPUOFFSET;
......
...@@ -79,7 +79,7 @@ static DEFINE_CLK(timer4, 23); ...@@ -79,7 +79,7 @@ static DEFINE_CLK(timer4, 23);
static struct clk_lookup nuc900_clkregs[] = { static struct clk_lookup nuc900_clkregs[] = {
DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL), DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL),
DEF_CLKLOOK(&clk_audio, "nuc900-audio", NULL), DEF_CLKLOOK(&clk_audio, "nuc900-ac97", NULL),
DEF_CLKLOOK(&clk_fmi, "nuc900-fmi", NULL), DEF_CLKLOOK(&clk_fmi, "nuc900-fmi", NULL),
DEF_CLKLOOK(&clk_ms, "nuc900-fmi", "MS"), DEF_CLKLOOK(&clk_ms, "nuc900-fmi", "MS"),
DEF_CLKLOOK(&clk_sd, "nuc900-fmi", "SD"), DEF_CLKLOOK(&clk_sd, "nuc900-fmi", "SD"),
......
...@@ -501,8 +501,8 @@ static struct resource nuc900_ac97_resource[] = { ...@@ -501,8 +501,8 @@ static struct resource nuc900_ac97_resource[] = {
}; };
struct platform_device nuc900_device_audio = { struct platform_device nuc900_device_ac97 = {
.name = "nuc900-audio", .name = "nuc900-ac97",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(nuc900_ac97_resource), .num_resources = ARRAY_SIZE(nuc900_ac97_resource),
.resource = nuc900_ac97_resource, .resource = nuc900_ac97_resource,
...@@ -523,7 +523,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = { ...@@ -523,7 +523,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = {
&nuc900_device_emc, &nuc900_device_emc,
&nuc900_device_spi, &nuc900_device_spi,
&nuc900_device_wdt, &nuc900_device_wdt,
&nuc900_device_audio, &nuc900_device_ac97,
}; };
/* Provide adding specific CPU platform devices API */ /* Provide adding specific CPU platform devices API */
......
...@@ -155,7 +155,7 @@ void mfp_set_groupg(struct device *dev, const char *subname) ...@@ -155,7 +155,7 @@ void mfp_set_groupg(struct device *dev, const char *subname)
} else if (strcmp(dev_id, "nuc900-i2c1") == 0) { } else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
mfpen &= ~(GPIOG2TO3); mfpen &= ~(GPIOG2TO3);
mfpen |= ENI2C1;/*enable i2c1*/ mfpen |= ENI2C1;/*enable i2c1*/
} else if (strcmp(dev_id, "nuc900-audio") == 0) { } else if (strcmp(dev_id, "nuc900-ac97") == 0) {
mfpen &= ~(GPIOG22TO23); mfpen &= ~(GPIOG22TO23);
mfpen |= ENAC97;/*enable AC97*/ mfpen |= ENAC97;/*enable AC97*/
} else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) { } else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/memblock.h> #include <linux/memblock.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/memblock.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/setup.h> #include <asm/setup.h>
...@@ -307,6 +308,21 @@ static void arm_memory_present(void) ...@@ -307,6 +308,21 @@ static void arm_memory_present(void)
} }
#endif #endif
static bool arm_memblock_steal_permitted = true;
phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align)
{
phys_addr_t phys;
BUG_ON(!arm_memblock_steal_permitted);
phys = memblock_alloc(size, align);
memblock_free(phys, size);
memblock_remove(phys, size);
return phys;
}
void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
{ {
int i; int i;
...@@ -349,6 +365,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) ...@@ -349,6 +365,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
if (mdesc->reserve) if (mdesc->reserve)
mdesc->reserve(); mdesc->reserve();
arm_memblock_steal_permitted = false;
memblock_allow_resize(); memblock_allow_resize();
memblock_dump_all(); memblock_dump_all();
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h>
#include <plat/tc.h> #include <plat/tc.h>
#include <plat/board.h> #include <plat/board.h>
...@@ -164,14 +165,12 @@ void __init omap_dsp_reserve_sdram_memblock(void) ...@@ -164,14 +165,12 @@ void __init omap_dsp_reserve_sdram_memblock(void)
if (!size) if (!size)
return; return;
paddr = memblock_alloc(size, SZ_1M); paddr = arm_memblock_steal(size, SZ_1M);
if (!paddr) { if (!paddr) {
pr_err("%s: failed to reserve %x bytes\n", pr_err("%s: failed to reserve %x bytes\n",
__func__, size); __func__, size);
return; return;
} }
memblock_free(paddr, size);
memblock_remove(paddr, size);
omap_dsp_phys_mempool_base = paddr; omap_dsp_phys_mempool_base = paddr;
} }
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <mach/system-reset.h>
#include <mach/regs-gpio.h> #include <mach/regs-gpio.h>
#include <plat/regs-serial.h> #include <plat/regs-serial.h>
......
...@@ -366,7 +366,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) ...@@ -366,7 +366,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev)
goto out3; goto out3;
/* enbale ac97 multifunction pin */ /* enbale ac97 multifunction pin */
mfp_set_groupg(nuc900_audio->dev, "nuc900-audio"); mfp_set_groupg(nuc900_audio->dev, NULL);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment