Merge branches 'fixes', 'misc' and 'sa1111-for-next' into for-next
This commit is contained in:
commit
7f3d1f9843
|
@ -2,6 +2,7 @@ config ARM
|
|||
bool
|
||||
default y
|
||||
select ARCH_CLOCKSOURCE_DATA
|
||||
select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID
|
||||
select ARCH_HAS_DEBUG_VIRTUAL
|
||||
select ARCH_HAS_DEVMEM_IS_ALLOWED
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
|
|
|
@ -116,8 +116,11 @@ ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
|
|||
asflags-y := -DZIMAGE
|
||||
|
||||
# Supply kernel BSS size to the decompressor via a linker symbol.
|
||||
KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \
|
||||
awk 'END{print $$3}')
|
||||
KBSS_SZ = $(shell $(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \
|
||||
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)
|
||||
# Supply ZRELADDR to the decompressor via a linker symbol.
|
||||
ifneq ($(CONFIG_AUTO_ZRELADDR),y)
|
||||
|
|
|
@ -143,6 +143,8 @@ start:
|
|||
.word _magic_start @ absolute load/run zImage address
|
||||
.word _magic_end @ zImage end address
|
||||
.word 0x04030201 @ endianness flag
|
||||
.word 0x45454545 @ another magic number to indicate
|
||||
.word _magic_table @ additional data table
|
||||
|
||||
__EFI_HEADER
|
||||
1:
|
||||
|
|
|
@ -44,12 +44,22 @@ SECTIONS
|
|||
*(.glue_7t)
|
||||
*(.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.*)
|
||||
}
|
||||
.piggydata : {
|
||||
*(.piggydata)
|
||||
__piggy_size_addr = . - 4;
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
|
@ -97,6 +107,7 @@ SECTIONS
|
|||
_magic_sig = ZIMAGE_MAGIC(0x016f2818);
|
||||
_magic_start = ZIMAGE_MAGIC(_start);
|
||||
_magic_end = ZIMAGE_MAGIC(_edata);
|
||||
_magic_table = ZIMAGE_MAGIC(_table_start - _start);
|
||||
|
||||
. = BSS_START;
|
||||
__bss_start = .;
|
||||
|
|
|
@ -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,
|
||||
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"
|
||||
* and utilize bounce buffers as needed to work around limited DMA windows.
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
} while (0)
|
||||
|
||||
extern pte_t *pkmap_page_table;
|
||||
extern pte_t *fixmap_page_table;
|
||||
|
||||
extern void *kmap_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)
|
|||
break;
|
||||
}
|
||||
|
||||
if (!mdesc) {
|
||||
early_print("\nError: unrecognized/unsupported machine ID"
|
||||
" (r1 = 0x%08x).\n\n", machine_nr);
|
||||
dump_machine_table(); /* does not return */
|
||||
}
|
||||
if (!mdesc)
|
||||
return NULL;
|
||||
|
||||
if (__atags_pointer)
|
||||
tags = phys_to_virt(__atags_pointer);
|
||||
|
|
|
@ -55,7 +55,9 @@ ENDPROC(printhex4)
|
|||
|
||||
ENTRY(printhex2)
|
||||
mov r1, #2
|
||||
printhex: adr r2, hexbuf
|
||||
printhex: adr r2, hexbuf_rel
|
||||
ldr r3, [r2]
|
||||
add r2, r2, r3
|
||||
add r3, r2, r1
|
||||
mov r1, #0
|
||||
strb r1, [r3]
|
||||
|
@ -71,7 +73,11 @@ printhex: adr r2, hexbuf
|
|||
b printascii
|
||||
ENDPROC(printhex2)
|
||||
|
||||
hexbuf: .space 16
|
||||
.pushsection .bss
|
||||
hexbuf_addr: .space 16
|
||||
.popsection
|
||||
.align
|
||||
hexbuf_rel: .long hexbuf_addr - .
|
||||
|
||||
.ltorg
|
||||
|
||||
|
@ -79,25 +85,28 @@ hexbuf: .space 16
|
|||
|
||||
ENTRY(printascii)
|
||||
addruart_current r3, r1, r2
|
||||
b 2f
|
||||
1: waituart r2, r3
|
||||
senduart r1, r3
|
||||
busyuart r2, r3
|
||||
teq r1, #'\n'
|
||||
moveq r1, #'\r'
|
||||
beq 1b
|
||||
2: teq r0, #0
|
||||
1: teq r0, #0
|
||||
ldrneb r1, [r0], #1
|
||||
teqne r1, #0
|
||||
bne 1b
|
||||
ret lr
|
||||
reteq 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)
|
||||
|
||||
ENTRY(printch)
|
||||
addruart_current r3, r1, r2
|
||||
mov r1, r0
|
||||
mov r0, #0
|
||||
b 1b
|
||||
b 2b
|
||||
ENDPROC(printch)
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
|
@ -124,7 +133,9 @@ ENTRY(printascii)
|
|||
ENDPROC(printascii)
|
||||
|
||||
ENTRY(printch)
|
||||
adr r1, hexbuf
|
||||
adr r1, hexbuf_rel
|
||||
ldr r2, [r1]
|
||||
add r1, r1, r2
|
||||
strb r0, [r1]
|
||||
mov r0, #0x03 @ SYS_WRITEC
|
||||
ARM( svc #0x123456 )
|
||||
|
|
|
@ -11,16 +11,20 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/console.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)
|
||||
{
|
||||
while (n-- > 0) {
|
||||
if (*s == '\n')
|
||||
printch('\r');
|
||||
printch(*s);
|
||||
s++;
|
||||
char buf[128];
|
||||
while (n) {
|
||||
unsigned l = min(n, sizeof(buf)-1);
|
||||
memcpy(buf, s, l);
|
||||
buf[l] = 0;
|
||||
s += l;
|
||||
n -= l;
|
||||
printascii(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -394,17 +394,8 @@ ENDPROC(sys_fstatfs64_wrapper)
|
|||
* offset, we return EINVAL.
|
||||
*/
|
||||
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]
|
||||
b sys_mmap_pgoff
|
||||
#endif
|
||||
ENDPROC(sys_mmap2)
|
||||
|
||||
#ifdef CONFIG_OABI_COMPAT
|
||||
|
|
|
@ -1069,6 +1069,16 @@ void __init setup_arch(char **cmdline_p)
|
|||
mdesc = setup_machine_fdt(__atags_pointer);
|
||||
if (!mdesc)
|
||||
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_name = 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)
|
|||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
|
@ -393,21 +393,6 @@ static int __init early_coherent_pool(char *p)
|
|||
}
|
||||
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.
|
||||
*/
|
||||
|
@ -443,7 +428,7 @@ static int __init atomic_pool_init(void)
|
|||
|
||||
gen_pool_set_algo(atomic_pool,
|
||||
gen_pool_first_fit_order_align,
|
||||
(void *)PAGE_SHIFT);
|
||||
NULL);
|
||||
pr_info("DMA: preallocated %zu KiB pool for atomic coherent allocations\n",
|
||||
atomic_pool_size / 1024);
|
||||
return 0;
|
||||
|
|
|
@ -580,16 +580,6 @@ void __init mem_init(void)
|
|||
BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
|
||||
BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
|
||||
#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
|
||||
|
|
|
@ -63,11 +63,12 @@
|
|||
#define IDX_IRQ_S1_READY_NINT (3)
|
||||
#define IDX_IRQ_S1_CD_VALID (4)
|
||||
#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)
|
||||
{
|
||||
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) {
|
||||
case 0:
|
||||
|
@ -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)
|
||||
{
|
||||
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;
|
||||
|
||||
switch (skt->nr) {
|
||||
|
@ -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;
|
||||
|
||||
local_irq_save(flags);
|
||||
val = sa1111_readl(s->dev->mapbase + PCCR);
|
||||
val = readl_relaxed(s->dev->mapbase + PCCR);
|
||||
val &= ~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);
|
||||
|
||||
return 0;
|
||||
|
@ -137,12 +138,18 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
|
|||
{
|
||||
struct sa1111_pcmcia_socket *s;
|
||||
struct clk *clk;
|
||||
int i, ret = 0;
|
||||
int i, ret = 0, irqs[NUM_IRQS];
|
||||
|
||||
clk = devm_clk_get(&dev->dev, NULL);
|
||||
if (IS_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;
|
||||
|
||||
for (i = 0; i < ops->nr; i++) {
|
||||
|
@ -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);
|
||||
s->dev = dev;
|
||||
if (s->soc.nr) {
|
||||
s->soc.socket.pci_irq = dev->irq[IDX_IRQ_S1_READY_NINT];
|
||||
s->soc.stat[SOC_STAT_CD].irq = dev->irq[IDX_IRQ_S1_CD_VALID];
|
||||
s->soc.socket.pci_irq = irqs[IDX_IRQ_S1_READY_NINT];
|
||||
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_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";
|
||||
} else {
|
||||
s->soc.socket.pci_irq = dev->irq[IDX_IRQ_S0_READY_NINT];
|
||||
s->soc.stat[SOC_STAT_CD].irq = dev->irq[IDX_IRQ_S0_CD_VALID];
|
||||
s->soc.socket.pci_irq = irqs[IDX_IRQ_S0_READY_NINT];
|
||||
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_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";
|
||||
}
|
||||
|
||||
|
@ -201,8 +208,8 @@ static int pcmcia_probe(struct sa1111_dev *dev)
|
|||
/*
|
||||
* Initialise the suspend state.
|
||||
*/
|
||||
sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR);
|
||||
sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR);
|
||||
writel_relaxed(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR);
|
||||
writel_relaxed(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR);
|
||||
|
||||
ret = -ENODEV;
|
||||
#ifdef CONFIG_SA1100_BADGE4
|
||||
|
|
Loading…
Reference in a new issue