Commit 7f3d1f98 authored by Russell King's avatar Russell King

Merge branches 'fixes', 'misc' and 'sa1111-for-next' into for-next

...@@ -2,6 +2,7 @@ config ARM ...@@ -2,6 +2,7 @@ config ARM
bool bool
default y default y
select ARCH_CLOCKSOURCE_DATA select ARCH_CLOCKSOURCE_DATA
select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID
select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEBUG_VIRTUAL
select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_DEVMEM_IS_ALLOWED
select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_ELF_RANDOMIZE
......
...@@ -116,8 +116,11 @@ ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj) ...@@ -116,8 +116,11 @@ ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
asflags-y := -DZIMAGE asflags-y := -DZIMAGE
# Supply kernel BSS size to the decompressor via a linker symbol. # Supply kernel BSS size to the decompressor via a linker symbol.
KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ KBSS_SZ = $(shell $(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \
awk 'END{print $$3}') perl -e 'while (<>) { \
$$bss_start=hex($$1) if /^([[:xdigit:]]+) B __bss_start$$/; \
$$bss_end=hex($$1) if /^([[:xdigit:]]+) B __bss_stop$$/; \
}; printf "%d\n", $$bss_end - $$bss_start;')
LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
# Supply ZRELADDR to the decompressor via a linker symbol. # Supply ZRELADDR to the decompressor via a linker symbol.
ifneq ($(CONFIG_AUTO_ZRELADDR),y) ifneq ($(CONFIG_AUTO_ZRELADDR),y)
......
...@@ -143,6 +143,8 @@ start: ...@@ -143,6 +143,8 @@ start:
.word _magic_start @ absolute load/run zImage address .word _magic_start @ absolute load/run zImage address
.word _magic_end @ zImage end address .word _magic_end @ zImage end address
.word 0x04030201 @ endianness flag .word 0x04030201 @ endianness flag
.word 0x45454545 @ another magic number to indicate
.word _magic_table @ additional data table
__EFI_HEADER __EFI_HEADER
1: 1:
......
...@@ -44,12 +44,22 @@ SECTIONS ...@@ -44,12 +44,22 @@ SECTIONS
*(.glue_7t) *(.glue_7t)
*(.glue_7) *(.glue_7)
} }
.table : ALIGN(4) {
_table_start = .;
LONG(ZIMAGE_MAGIC(2))
LONG(ZIMAGE_MAGIC(0x5a534c4b))
LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
LONG(ZIMAGE_MAGIC(_kernel_bss_size))
LONG(0)
_table_end = .;
}
.rodata : { .rodata : {
*(.rodata) *(.rodata)
*(.rodata.*) *(.rodata.*)
} }
.piggydata : { .piggydata : {
*(.piggydata) *(.piggydata)
__piggy_size_addr = . - 4;
} }
. = ALIGN(4); . = ALIGN(4);
...@@ -97,6 +107,7 @@ SECTIONS ...@@ -97,6 +107,7 @@ SECTIONS
_magic_sig = ZIMAGE_MAGIC(0x016f2818); _magic_sig = ZIMAGE_MAGIC(0x016f2818);
_magic_start = ZIMAGE_MAGIC(_start); _magic_start = ZIMAGE_MAGIC(_start);
_magic_end = ZIMAGE_MAGIC(_edata); _magic_end = ZIMAGE_MAGIC(_edata);
_magic_table = ZIMAGE_MAGIC(_table_start - _start);
. = BSS_START; . = BSS_START;
__bss_start = .; __bss_start = .;
......
...@@ -189,13 +189,6 @@ extern int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma, ...@@ -189,13 +189,6 @@ extern int arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
void *cpu_addr, dma_addr_t dma_addr, size_t size, void *cpu_addr, dma_addr_t dma_addr, size_t size,
unsigned long attrs); unsigned long attrs);
/*
* This can be called during early boot to increase the size of the atomic
* coherent DMA pool above the default value of 256KiB. It must be called
* before postcore_initcall.
*/
extern void __init init_dma_coherent_pool_size(unsigned long size);
/* /*
* For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic" * For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic"
* and utilize bounce buffers as needed to work around limited DMA windows. * and utilize bounce buffers as needed to work around limited DMA windows.
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
} while (0) } while (0)
extern pte_t *pkmap_page_table; extern pte_t *pkmap_page_table;
extern pte_t *fixmap_page_table;
extern void *kmap_high(struct page *page); extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page); extern void kunmap_high(struct page *page);
......
...@@ -196,11 +196,8 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) ...@@ -196,11 +196,8 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
break; break;
} }
if (!mdesc) { if (!mdesc)
early_print("\nError: unrecognized/unsupported machine ID" return NULL;
" (r1 = 0x%08x).\n\n", machine_nr);
dump_machine_table(); /* does not return */
}
if (__atags_pointer) if (__atags_pointer)
tags = phys_to_virt(__atags_pointer); tags = phys_to_virt(__atags_pointer);
......
...@@ -55,7 +55,9 @@ ENDPROC(printhex4) ...@@ -55,7 +55,9 @@ ENDPROC(printhex4)
ENTRY(printhex2) ENTRY(printhex2)
mov r1, #2 mov r1, #2
printhex: adr r2, hexbuf printhex: adr r2, hexbuf_rel
ldr r3, [r2]
add r2, r2, r3
add r3, r2, r1 add r3, r2, r1
mov r1, #0 mov r1, #0
strb r1, [r3] strb r1, [r3]
...@@ -71,7 +73,11 @@ printhex: adr r2, hexbuf ...@@ -71,7 +73,11 @@ printhex: adr r2, hexbuf
b printascii b printascii
ENDPROC(printhex2) ENDPROC(printhex2)
hexbuf: .space 16 .pushsection .bss
hexbuf_addr: .space 16
.popsection
.align
hexbuf_rel: .long hexbuf_addr - .
.ltorg .ltorg
...@@ -79,25 +85,28 @@ hexbuf: .space 16 ...@@ -79,25 +85,28 @@ hexbuf: .space 16
ENTRY(printascii) ENTRY(printascii)
addruart_current r3, r1, r2 addruart_current r3, r1, r2
b 2f 1: teq r0, #0
1: waituart r2, r3
senduart r1, r3
busyuart r2, r3
teq r1, #'\n'
moveq r1, #'\r'
beq 1b
2: teq r0, #0
ldrneb r1, [r0], #1 ldrneb r1, [r0], #1
teqne r1, #0 teqne r1, #0
bne 1b reteq lr
ret lr 2: teq r1, #'\n'
bne 3f
mov r1, #'\r'
waituart r2, r3
senduart r1, r3
busyuart r2, r3
mov r1, #'\n'
3: waituart r2, r3
senduart r1, r3
busyuart r2, r3
b 1b
ENDPROC(printascii) ENDPROC(printascii)
ENTRY(printch) ENTRY(printch)
addruart_current r3, r1, r2 addruart_current r3, r1, r2
mov r1, r0 mov r1, r0
mov r0, #0 mov r0, #0
b 1b b 2b
ENDPROC(printch) ENDPROC(printch)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
...@@ -124,7 +133,9 @@ ENTRY(printascii) ...@@ -124,7 +133,9 @@ ENTRY(printascii)
ENDPROC(printascii) ENDPROC(printascii)
ENTRY(printch) ENTRY(printch)
adr r1, hexbuf adr r1, hexbuf_rel
ldr r2, [r1]
add r1, r1, r2
strb r0, [r1] strb r0, [r1]
mov r0, #0x03 @ SYS_WRITEC mov r0, #0x03 @ SYS_WRITEC
ARM( svc #0x123456 ) ARM( svc #0x123456 )
......
...@@ -11,16 +11,20 @@ ...@@ -11,16 +11,20 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h>
extern void printch(int); extern void printascii(const char *);
static void early_write(const char *s, unsigned n) static void early_write(const char *s, unsigned n)
{ {
while (n-- > 0) { char buf[128];
if (*s == '\n') while (n) {
printch('\r'); unsigned l = min(n, sizeof(buf)-1);
printch(*s); memcpy(buf, s, l);
s++; buf[l] = 0;
s += l;
n -= l;
printascii(buf);
} }
} }
......
...@@ -394,17 +394,8 @@ ENDPROC(sys_fstatfs64_wrapper) ...@@ -394,17 +394,8 @@ ENDPROC(sys_fstatfs64_wrapper)
* offset, we return EINVAL. * offset, we return EINVAL.
*/ */
sys_mmap2: sys_mmap2:
#if PAGE_SHIFT > 12
tst r5, #PGOFF_MASK
moveq r5, r5, lsr #PAGE_SHIFT - 12
streq r5, [sp, #4]
beq sys_mmap_pgoff
mov r0, #-EINVAL
ret lr
#else
str r5, [sp, #4] str r5, [sp, #4]
b sys_mmap_pgoff b sys_mmap_pgoff
#endif
ENDPROC(sys_mmap2) ENDPROC(sys_mmap2)
#ifdef CONFIG_OABI_COMPAT #ifdef CONFIG_OABI_COMPAT
......
...@@ -1069,6 +1069,16 @@ void __init setup_arch(char **cmdline_p) ...@@ -1069,6 +1069,16 @@ void __init setup_arch(char **cmdline_p)
mdesc = setup_machine_fdt(__atags_pointer); mdesc = setup_machine_fdt(__atags_pointer);
if (!mdesc) if (!mdesc)
mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);
if (!mdesc) {
early_print("\nError: invalid dtb and unrecognized/unsupported machine ID\n");
early_print(" r1=0x%08x, r2=0x%08x\n", __machine_arch_type,
__atags_pointer);
if (__atags_pointer)
early_print(" r2[]=%*ph\n", 16,
phys_to_virt(__atags_pointer));
dump_machine_table();
}
machine_desc = mdesc; machine_desc = mdesc;
machine_name = mdesc->name; machine_name = mdesc->name;
dump_stack_set_arch_desc("%s", mdesc->name); dump_stack_set_arch_desc("%s", mdesc->name);
......
...@@ -382,9 +382,9 @@ static void __dma_free_remap(void *cpu_addr, size_t size) ...@@ -382,9 +382,9 @@ static void __dma_free_remap(void *cpu_addr, size_t size)
} }
#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
static struct gen_pool *atomic_pool; static struct gen_pool *atomic_pool __ro_after_init;
static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE; static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
static int __init early_coherent_pool(char *p) static int __init early_coherent_pool(char *p)
{ {
...@@ -393,21 +393,6 @@ static int __init early_coherent_pool(char *p) ...@@ -393,21 +393,6 @@ static int __init early_coherent_pool(char *p)
} }
early_param("coherent_pool", early_coherent_pool); early_param("coherent_pool", early_coherent_pool);
void __init init_dma_coherent_pool_size(unsigned long size)
{
/*
* Catch any attempt to set the pool size too late.
*/
BUG_ON(atomic_pool);
/*
* Set architecture specific coherent pool size only if
* it has not been changed by kernel command line parameter.
*/
if (atomic_pool_size == DEFAULT_DMA_COHERENT_POOL_SIZE)
atomic_pool_size = size;
}
/* /*
* Initialise the coherent pool for atomic allocations. * Initialise the coherent pool for atomic allocations.
*/ */
...@@ -443,7 +428,7 @@ static int __init atomic_pool_init(void) ...@@ -443,7 +428,7 @@ static int __init atomic_pool_init(void)
gen_pool_set_algo(atomic_pool, gen_pool_set_algo(atomic_pool,
gen_pool_first_fit_order_align, gen_pool_first_fit_order_align,
(void *)PAGE_SHIFT); NULL);
pr_info("DMA: preallocated %zu KiB pool for atomic coherent allocations\n", pr_info("DMA: preallocated %zu KiB pool for atomic coherent allocations\n",
atomic_pool_size / 1024); atomic_pool_size / 1024);
return 0; return 0;
......
...@@ -580,16 +580,6 @@ void __init mem_init(void) ...@@ -580,16 +580,6 @@ void __init mem_init(void)
BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET); BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET); BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
#endif #endif
if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) {
extern int sysctl_overcommit_memory;
/*
* On a machine this small we won't get
* anywhere without overcommit, so turn
* it on by default.
*/
sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
}
} }
#ifdef CONFIG_STRICT_KERNEL_RWX #ifdef CONFIG_STRICT_KERNEL_RWX
......
...@@ -63,11 +63,12 @@ ...@@ -63,11 +63,12 @@
#define IDX_IRQ_S1_READY_NINT (3) #define IDX_IRQ_S1_READY_NINT (3)
#define IDX_IRQ_S1_CD_VALID (4) #define IDX_IRQ_S1_CD_VALID (4)
#define IDX_IRQ_S1_BVD1_STSCHG (5) #define IDX_IRQ_S1_BVD1_STSCHG (5)
#define NUM_IRQS (6)
void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
{ {
struct sa1111_pcmcia_socket *s = to_skt(skt); struct sa1111_pcmcia_socket *s = to_skt(skt);
unsigned long status = sa1111_readl(s->dev->mapbase + PCSR); u32 status = readl_relaxed(s->dev->mapbase + PCSR);
switch (skt->nr) { switch (skt->nr) {
case 0: case 0:
...@@ -95,7 +96,7 @@ void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_sta ...@@ -95,7 +96,7 @@ void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_sta
int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
{ {
struct sa1111_pcmcia_socket *s = to_skt(skt); struct sa1111_pcmcia_socket *s = to_skt(skt);
unsigned int pccr_skt_mask, pccr_set_mask, val; u32 pccr_skt_mask, pccr_set_mask, val;
unsigned long flags; unsigned long flags;
switch (skt->nr) { switch (skt->nr) {
...@@ -123,10 +124,10 @@ int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s ...@@ -123,10 +124,10 @@ int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s
pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT; pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT;
local_irq_save(flags); local_irq_save(flags);
val = sa1111_readl(s->dev->mapbase + PCCR); val = readl_relaxed(s->dev->mapbase + PCCR);
val &= ~pccr_skt_mask; val &= ~pccr_skt_mask;
val |= pccr_set_mask & pccr_skt_mask; val |= pccr_set_mask & pccr_skt_mask;
sa1111_writel(val, s->dev->mapbase + PCCR); writel_relaxed(val, s->dev->mapbase + PCCR);
local_irq_restore(flags); local_irq_restore(flags);
return 0; return 0;
...@@ -137,12 +138,18 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ...@@ -137,12 +138,18 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
{ {
struct sa1111_pcmcia_socket *s; struct sa1111_pcmcia_socket *s;
struct clk *clk; struct clk *clk;
int i, ret = 0; int i, ret = 0, irqs[NUM_IRQS];
clk = devm_clk_get(&dev->dev, NULL); clk = devm_clk_get(&dev->dev, NULL);
if (IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
for (i = 0; i < NUM_IRQS; i++) {
irqs[i] = sa1111_get_irq(dev, i);
if (irqs[i] <= 0)
return irqs[i] ? : -ENXIO;
}
ops->socket_state = sa1111_pcmcia_socket_state; ops->socket_state = sa1111_pcmcia_socket_state;
for (i = 0; i < ops->nr; i++) { for (i = 0; i < ops->nr; i++) {
...@@ -156,16 +163,16 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, ...@@ -156,16 +163,16 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
soc_pcmcia_init_one(&s->soc, ops, &dev->dev); soc_pcmcia_init_one(&s->soc, ops, &dev->dev);
s->dev = dev; s->dev = dev;
if (s->soc.nr) { if (s->soc.nr) {
s->soc.socket.pci_irq = dev->irq[IDX_IRQ_S1_READY_NINT]; s->soc.socket.pci_irq = irqs[IDX_IRQ_S1_READY_NINT];
s->soc.stat[SOC_STAT_CD].irq = dev->irq[IDX_IRQ_S1_CD_VALID]; s->soc.stat[SOC_STAT_CD].irq = irqs[IDX_IRQ_S1_CD_VALID];
s->soc.stat[SOC_STAT_CD].name = "SA1111 CF card detect"; s->soc.stat[SOC_STAT_CD].name = "SA1111 CF card detect";
s->soc.stat[SOC_STAT_BVD1].irq = dev->irq[IDX_IRQ_S1_BVD1_STSCHG]; s->soc.stat[SOC_STAT_BVD1].irq = irqs[IDX_IRQ_S1_BVD1_STSCHG];
s->soc.stat[SOC_STAT_BVD1].name = "SA1111 CF BVD1"; s->soc.stat[SOC_STAT_BVD1].name = "SA1111 CF BVD1";
} else { } else {
s->soc.socket.pci_irq = dev->irq[IDX_IRQ_S0_READY_NINT]; s->soc.socket.pci_irq = irqs[IDX_IRQ_S0_READY_NINT];
s->soc.stat[SOC_STAT_CD].irq = dev->irq[IDX_IRQ_S0_CD_VALID]; s->soc.stat[SOC_STAT_CD].irq = irqs[IDX_IRQ_S0_CD_VALID];
s->soc.stat[SOC_STAT_CD].name = "SA1111 PCMCIA card detect"; s->soc.stat[SOC_STAT_CD].name = "SA1111 PCMCIA card detect";
s->soc.stat[SOC_STAT_BVD1].irq = dev->irq[IDX_IRQ_S0_BVD1_STSCHG]; s->soc.stat[SOC_STAT_BVD1].irq = irqs[IDX_IRQ_S0_BVD1_STSCHG];
s->soc.stat[SOC_STAT_BVD1].name = "SA1111 PCMCIA BVD1"; s->soc.stat[SOC_STAT_BVD1].name = "SA1111 PCMCIA BVD1";
} }
...@@ -201,8 +208,8 @@ static int pcmcia_probe(struct sa1111_dev *dev) ...@@ -201,8 +208,8 @@ static int pcmcia_probe(struct sa1111_dev *dev)
/* /*
* Initialise the suspend state. * Initialise the suspend state.
*/ */
sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); writel_relaxed(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR);
sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); writel_relaxed(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR);
ret = -ENODEV; ret = -ENODEV;
#ifdef CONFIG_SA1100_BADGE4 #ifdef CONFIG_SA1100_BADGE4
......
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