diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 16:40:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 16:40:47 -0700 |
commit | fce4a1dda2f1a9a25b3e5b7cd951070e0b42a818 (patch) | |
tree | 03a3f76c5b3d4f3b05dff44c307dbbb64ec5c510 /arch/mips/lantiq/setup.c | |
parent | e1f2084ed200eb31f2c9d1efe70569c76889c980 (diff) | |
parent | 6f6c3c33c027f2c83d53e8562cd9daa73fe8108b (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: (48 commits)
MIPS: Move arch_get_unmapped_area and gang to new file.
MIPS: Cleanup arch_get_unmapped_area
MIPS: Octeon: Don't request interrupts for unused IPI mailbox bits.
Octeon: Fix interrupt irq settings for performance counters.
MIPS: Fix build warnings on defconfigs
MIPS: Lemote 2F, Malta: Fix build warning
MIPS: Set ELF AT_PLATFORM string for Loongson2 processors
MIPS: Set ELF AT_PLATFORM string for BMIPS processors
MIPS: Introduce set_elf_platform() helper function
MIPS: JZ4740: setup: Autodetect physical memory.
MIPS: BCM47xx: Fix MAC address parsing.
MIPS: BCM47xx: Extend the filling of SPROM from NVRAM
MIPS: BCM47xx: Register SSB fallback sprom callback
MIPS: BCM47xx: Extend bcm47xx_fill_sprom with prefix.
SSB: Change fallback sprom to callback mechanism.
MIPS: Alchemy: Clean up GPIO registers and accessors
MIPS: Alchemy: Cleanup DMA addresses
MIPS: Alchemy: Rewrite ethernet platform setup
MIPS: Alchemy: Rewrite UART setup and constants.
MIPS: Alchemy: Convert dbdma.c to syscore_ops
...
Diffstat (limited to 'arch/mips/lantiq/setup.c')
-rw-r--r-- | arch/mips/lantiq/setup.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/mips/lantiq/setup.c b/arch/mips/lantiq/setup.c new file mode 100644 index 000000000000..9b8af77ed0f9 --- /dev/null +++ b/arch/mips/lantiq/setup.c @@ -0,0 +1,66 @@ +/* + * 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. + * + * Copyright (C) 2010 John Crispin <blogic@openwrt.org> + */ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/io.h> +#include <linux/ioport.h> +#include <asm/bootinfo.h> + +#include <lantiq_soc.h> + +#include "machtypes.h" +#include "devices.h" +#include "prom.h" + +void __init plat_mem_setup(void) +{ + /* assume 16M as default incase uboot fails to pass proper ramsize */ + unsigned long memsize = 16; + char **envp = (char **) KSEG1ADDR(fw_arg2); + + ioport_resource.start = IOPORT_RESOURCE_START; + ioport_resource.end = IOPORT_RESOURCE_END; + iomem_resource.start = IOMEM_RESOURCE_START; + iomem_resource.end = IOMEM_RESOURCE_END; + + set_io_port_base((unsigned long) KSEG1); + + while (*envp) { + char *e = (char *)KSEG1ADDR(*envp); + if (!strncmp(e, "memsize=", 8)) { + e += 8; + if (strict_strtoul(e, 0, &memsize)) + pr_warn("bad memsize specified\n"); + } + envp++; + } + memsize *= 1024 * 1024; + add_memory_region(0x00000000, memsize, BOOT_MEM_RAM); +} + +static int __init +lantiq_setup(void) +{ + ltq_soc_setup(); + mips_machine_setup(); + return 0; +} + +arch_initcall(lantiq_setup); + +static void __init +lantiq_generic_init(void) +{ + /* Nothing to do */ +} + +MIPS_MACHINE(LTQ_MACH_GENERIC, + "Generic", + "Generic Lantiq based board", + lantiq_generic_init); |