diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/mips/lantiq/setup.c | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
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 00000000000..9b8af77ed0f --- /dev/null +++ b/arch/mips/lantiq/setup.c | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | /* | ||
| 2 | * This program is free software; you can redistribute it and/or modify it | ||
| 3 | * under the terms of the GNU General Public License version 2 as published | ||
| 4 | * by the Free Software Foundation. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2010 John Crispin <blogic@openwrt.org> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <linux/module.h> | ||
| 11 | #include <linux/io.h> | ||
| 12 | #include <linux/ioport.h> | ||
| 13 | #include <asm/bootinfo.h> | ||
| 14 | |||
| 15 | #include <lantiq_soc.h> | ||
| 16 | |||
| 17 | #include "machtypes.h" | ||
| 18 | #include "devices.h" | ||
| 19 | #include "prom.h" | ||
| 20 | |||
| 21 | void __init plat_mem_setup(void) | ||
| 22 | { | ||
| 23 | /* assume 16M as default incase uboot fails to pass proper ramsize */ | ||
| 24 | unsigned long memsize = 16; | ||
| 25 | char **envp = (char **) KSEG1ADDR(fw_arg2); | ||
| 26 | |||
| 27 | ioport_resource.start = IOPORT_RESOURCE_START; | ||
| 28 | ioport_resource.end = IOPORT_RESOURCE_END; | ||
| 29 | iomem_resource.start = IOMEM_RESOURCE_START; | ||
| 30 | iomem_resource.end = IOMEM_RESOURCE_END; | ||
| 31 | |||
| 32 | set_io_port_base((unsigned long) KSEG1); | ||
| 33 | |||
| 34 | while (*envp) { | ||
| 35 | char *e = (char *)KSEG1ADDR(*envp); | ||
| 36 | if (!strncmp(e, "memsize=", 8)) { | ||
| 37 | e += 8; | ||
| 38 | if (strict_strtoul(e, 0, &memsize)) | ||
| 39 | pr_warn("bad memsize specified\n"); | ||
| 40 | } | ||
| 41 | envp++; | ||
| 42 | } | ||
| 43 | memsize *= 1024 * 1024; | ||
| 44 | add_memory_region(0x00000000, memsize, BOOT_MEM_RAM); | ||
| 45 | } | ||
| 46 | |||
| 47 | static int __init | ||
| 48 | lantiq_setup(void) | ||
| 49 | { | ||
| 50 | ltq_soc_setup(); | ||
| 51 | mips_machine_setup(); | ||
| 52 | return 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | arch_initcall(lantiq_setup); | ||
| 56 | |||
| 57 | static void __init | ||
| 58 | lantiq_generic_init(void) | ||
| 59 | { | ||
| 60 | /* Nothing to do */ | ||
| 61 | } | ||
| 62 | |||
| 63 | MIPS_MACHINE(LTQ_MACH_GENERIC, | ||
| 64 | "Generic", | ||
| 65 | "Generic Lantiq based board", | ||
| 66 | lantiq_generic_init); | ||
