diff options
author | David Daney <ddaney@caviumnetworks.com> | 2009-01-08 19:46:40 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-01-11 04:57:21 -0500 |
commit | 5b3b16880f404ca54126210ca86141cceeafc0cf (patch) | |
tree | f69d30450a923782534d4ae257f20aace0a0be74 /arch/mips/cavium-octeon/flash_setup.c | |
parent | 58f07778ce9d32c22cecb1d8ef348001f0e705c9 (diff) |
MIPS: Add Cavium OCTEON processor support files to arch/mips/cavium-octeon.
These are the rest of the new files needed to add OCTEON processor
support to the Linux kernel. Other than Makefile and Kconfig which
should be obvious, we have:
csrc-octeon.c -- Clock source driver for OCTEON.
dma-octeon.c -- Helper functions for mapping DMA memory.
flash_setup.c -- Register on-board flash with the MTD subsystem.
octeon-irq.c -- OCTEON interrupt controller managment.
octeon-memcpy.S -- Optimized memcpy() implementation.
serial.c -- Register 8250 platform driver and early console.
setup.c -- Early architecture initialization.
smp.c -- OCTEON SMP support.
octeon_switch.S -- Scheduler context switch for OCTEON.
c-octeon.c -- OCTEON cache controller support.
cex-oct.S -- OCTEON cache exception handler.
asm/mach-cavium-octeon/*.h -- Architecture include files.
Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
create mode 100644 arch/mips/cavium-octeon/Kconfig
create mode 100644 arch/mips/cavium-octeon/Makefile
create mode 100644 arch/mips/cavium-octeon/csrc-octeon.c
create mode 100644 arch/mips/cavium-octeon/dma-octeon.c
create mode 100644 arch/mips/cavium-octeon/flash_setup.c
create mode 100644 arch/mips/cavium-octeon/octeon-irq.c
create mode 100644 arch/mips/cavium-octeon/octeon-memcpy.S
create mode 100644 arch/mips/cavium-octeon/serial.c
create mode 100644 arch/mips/cavium-octeon/setup.c
create mode 100644 arch/mips/cavium-octeon/smp.c
create mode 100644 arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
create mode 100644 arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
create mode 100644 arch/mips/include/asm/mach-cavium-octeon/irq.h
create mode 100644 arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h
create mode 100644 arch/mips/include/asm/mach-cavium-octeon/war.h
create mode 100644 arch/mips/include/asm/octeon/octeon.h
create mode 100644 arch/mips/kernel/octeon_switch.S
create mode 100644 arch/mips/mm/c-octeon.c
create mode 100644 arch/mips/mm/cex-oct.S
Diffstat (limited to 'arch/mips/cavium-octeon/flash_setup.c')
-rw-r--r-- | arch/mips/cavium-octeon/flash_setup.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c new file mode 100644 index 000000000000..553d36cbcc42 --- /dev/null +++ b/arch/mips/cavium-octeon/flash_setup.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Octeon Bootbus flash setup | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2007, 2008 Cavium Networks | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/mtd/mtd.h> | ||
12 | #include <linux/mtd/map.h> | ||
13 | #include <linux/mtd/partitions.h> | ||
14 | |||
15 | #include <asm/octeon/octeon.h> | ||
16 | |||
17 | static struct map_info flash_map; | ||
18 | static struct mtd_info *mymtd; | ||
19 | #ifdef CONFIG_MTD_PARTITIONS | ||
20 | static int nr_parts; | ||
21 | static struct mtd_partition *parts; | ||
22 | static const char *part_probe_types[] = { | ||
23 | "cmdlinepart", | ||
24 | #ifdef CONFIG_MTD_REDBOOT_PARTS | ||
25 | "RedBoot", | ||
26 | #endif | ||
27 | NULL | ||
28 | }; | ||
29 | #endif | ||
30 | |||
31 | /** | ||
32 | * Module/ driver initialization. | ||
33 | * | ||
34 | * Returns Zero on success | ||
35 | */ | ||
36 | static int __init flash_init(void) | ||
37 | { | ||
38 | /* | ||
39 | * Read the bootbus region 0 setup to determine the base | ||
40 | * address of the flash. | ||
41 | */ | ||
42 | union cvmx_mio_boot_reg_cfgx region_cfg; | ||
43 | region_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(0)); | ||
44 | if (region_cfg.s.en) { | ||
45 | /* | ||
46 | * The bootloader always takes the flash and sets its | ||
47 | * address so the entire flash fits below | ||
48 | * 0x1fc00000. This way the flash aliases to | ||
49 | * 0x1fc00000 for booting. Software can access the | ||
50 | * full flash at the true address, while core boot can | ||
51 | * access 4MB. | ||
52 | */ | ||
53 | /* Use this name so old part lines work */ | ||
54 | flash_map.name = "phys_mapped_flash"; | ||
55 | flash_map.phys = region_cfg.s.base << 16; | ||
56 | flash_map.size = 0x1fc00000 - flash_map.phys; | ||
57 | flash_map.bankwidth = 1; | ||
58 | flash_map.virt = ioremap(flash_map.phys, flash_map.size); | ||
59 | pr_notice("Bootbus flash: Setting flash for %luMB flash at " | ||
60 | "0x%08lx\n", flash_map.size >> 20, flash_map.phys); | ||
61 | simple_map_init(&flash_map); | ||
62 | mymtd = do_map_probe("cfi_probe", &flash_map); | ||
63 | if (mymtd) { | ||
64 | mymtd->owner = THIS_MODULE; | ||
65 | |||
66 | #ifdef CONFIG_MTD_PARTITIONS | ||
67 | nr_parts = parse_mtd_partitions(mymtd, | ||
68 | part_probe_types, | ||
69 | &parts, 0); | ||
70 | if (nr_parts > 0) | ||
71 | add_mtd_partitions(mymtd, parts, nr_parts); | ||
72 | else | ||
73 | add_mtd_device(mymtd); | ||
74 | #else | ||
75 | add_mtd_device(mymtd); | ||
76 | #endif | ||
77 | } else { | ||
78 | pr_err("Failed to register MTD device for flash\n"); | ||
79 | } | ||
80 | } | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | late_initcall(flash_init); | ||