diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 20:56:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 20:56:37 -0500 |
commit | c0222ac086669a631814bbf857f8c8023452a4d7 (patch) | |
tree | bb1d9908031fcf69016eeefa7b35a4f68f414333 /arch/mips/loongson/common | |
parent | 140cd7fb04a4a2bc09a30980bc8104cc89e09330 (diff) | |
parent | e2965cd0003f222bd49f67907c2bc6ed691c6d20 (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
"This is an unusually large pull request for MIPS - in parts because
lots of patches missed the 3.18 deadline but primarily because some
folks opened the flood gates.
- Retire the MIPS-specific phys_t with the generic phys_addr_t.
- Improvments for the backtrace code used by oprofile.
- Better backtraces on SMP systems.
- Cleanups for the Octeon platform code.
- Cleanups and fixes for the Loongson platform code.
- Cleanups and fixes to the firmware library.
- Switch ATH79 platform to use the firmware library.
- Grand overhault to the SEAD3 and Malta interrupt code.
- Move the GIC interrupt code to drivers/irqchip
- Lots of GIC cleanups and updates to the GIC code to use modern IRQ
infrastructures and features of the kernel.
- OF documentation updates for the GIC bindings
- Move GIC clocksource driver to drivers/clocksource
- Merge GIC clocksource driver with clockevent driver.
- Further updates to bring the GIC clocksource driver up to date.
- R3000 TLB code cleanups
- Improvments to the Loongson 3 platform code.
- Convert pr_warning to pr_warn.
- Merge a bunch of small lantiq and ralink fixes that have been
staged/lingering inside the openwrt tree for a while.
- Update archhelp for IP22/IP32
- Fix a number of issues for Loongson 1B.
- New clocksource and clockevent driver for Loongson 1B.
- Further work on clk handling for Loongson 1B.
- Platform work for Broadcom BMIPS.
- Error handling cleanups for TurboChannel.
- Fixes and optimization to the microMIPS support.
- Option to disable the FTLB.
- Dump more relevant information on machine check exception
- Change binfmt to allow arch to examine PT_*PROC headers
- Support for new style FPU register model in O32
- VDSO randomization.
- BCM47xx cleanups
- BCM47xx reimplement the way the kernel accesses NVRAM information.
- Random cleanups
- Add support for ATH25 platforms
- Remove pointless locking code in some PCI platforms.
- Some improvments to EVA support
- Minor Alchemy cleanup"
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (185 commits)
MIPS: Add MFHC0 and MTHC0 instructions to uasm.
MIPS: Cosmetic cleanups of page table headers.
MIPS: Add CP0 macros for extended EntryLo registers
MIPS: Remove now unused definition of phys_t.
MIPS: Replace use of phys_t with phys_addr_t.
MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT
PCMCIA: Alchemy Don't select 64BIT_PHYS_ADDR in Kconfig.
MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery
MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO
MIPS: <asm/types.h> fix indentation.
MAINTAINERS: Add entry for BMIPS multiplatform kernel
MIPS: Enable VDSO randomization
MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration
MIPS: Remove declaration of obsolete arch_init_clk_ops()
MIPS: atomic.h: Reformat to fit in 79 columns
MIPS: Apply `.insn' to fixup labels throughout
MIPS: Fix microMIPS LL/SC immediate offsets
MIPS: Kconfig: Only allow 32-bit microMIPS builds
MIPS: signal.c: Fix an invalid cast in ISA mode bit handling
MIPS: mm: Only build one microassembler that is suitable
...
Diffstat (limited to 'arch/mips/loongson/common')
-rw-r--r-- | arch/mips/loongson/common/cs5536/cs5536_pci.c | 25 | ||||
-rw-r--r-- | arch/mips/loongson/common/dma-swiotlb.c | 14 | ||||
-rw-r--r-- | arch/mips/loongson/common/early_printk.c | 2 | ||||
-rw-r--r-- | arch/mips/loongson/common/env.c | 28 | ||||
-rw-r--r-- | arch/mips/loongson/common/gpio.c | 2 | ||||
-rw-r--r-- | arch/mips/loongson/common/init.c | 1 | ||||
-rw-r--r-- | arch/mips/loongson/common/machtype.c | 23 | ||||
-rw-r--r-- | arch/mips/loongson/common/rtc.c | 2 | ||||
-rw-r--r-- | arch/mips/loongson/common/serial.c | 66 | ||||
-rw-r--r-- | arch/mips/loongson/common/setup.c | 1 | ||||
-rw-r--r-- | arch/mips/loongson/common/time.c | 5 | ||||
-rw-r--r-- | arch/mips/loongson/common/uart_base.c | 30 |
12 files changed, 136 insertions, 63 deletions
diff --git a/arch/mips/loongson/common/cs5536/cs5536_pci.c b/arch/mips/loongson/common/cs5536/cs5536_pci.c index 81bed9d18061..b739723205f8 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_pci.c +++ b/arch/mips/loongson/common/cs5536/cs5536_pci.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <cs5536/cs5536_pci.h> | ||
24 | #include <cs5536/cs5536_vsm.h> | 25 | #include <cs5536/cs5536_vsm.h> |
25 | 26 | ||
26 | enum { | 27 | enum { |
@@ -35,21 +36,21 @@ enum { | |||
35 | }; | 36 | }; |
36 | 37 | ||
37 | static const cs5536_pci_vsm_write vsm_conf_write[] = { | 38 | static const cs5536_pci_vsm_write vsm_conf_write[] = { |
38 | [CS5536_ISA_FUNC] pci_isa_write_reg, | 39 | [CS5536_ISA_FUNC] = pci_isa_write_reg, |
39 | [reserved_func] NULL, | 40 | [reserved_func] = NULL, |
40 | [CS5536_IDE_FUNC] pci_ide_write_reg, | 41 | [CS5536_IDE_FUNC] = pci_ide_write_reg, |
41 | [CS5536_ACC_FUNC] pci_acc_write_reg, | 42 | [CS5536_ACC_FUNC] = pci_acc_write_reg, |
42 | [CS5536_OHCI_FUNC] pci_ohci_write_reg, | 43 | [CS5536_OHCI_FUNC] = pci_ohci_write_reg, |
43 | [CS5536_EHCI_FUNC] pci_ehci_write_reg, | 44 | [CS5536_EHCI_FUNC] = pci_ehci_write_reg, |
44 | }; | 45 | }; |
45 | 46 | ||
46 | static const cs5536_pci_vsm_read vsm_conf_read[] = { | 47 | static const cs5536_pci_vsm_read vsm_conf_read[] = { |
47 | [CS5536_ISA_FUNC] pci_isa_read_reg, | 48 | [CS5536_ISA_FUNC] = pci_isa_read_reg, |
48 | [reserved_func] NULL, | 49 | [reserved_func] = NULL, |
49 | [CS5536_IDE_FUNC] pci_ide_read_reg, | 50 | [CS5536_IDE_FUNC] = pci_ide_read_reg, |
50 | [CS5536_ACC_FUNC] pci_acc_read_reg, | 51 | [CS5536_ACC_FUNC] = pci_acc_read_reg, |
51 | [CS5536_OHCI_FUNC] pci_ohci_read_reg, | 52 | [CS5536_OHCI_FUNC] = pci_ohci_read_reg, |
52 | [CS5536_EHCI_FUNC] pci_ehci_read_reg, | 53 | [CS5536_EHCI_FUNC] = pci_ehci_read_reg, |
53 | }; | 54 | }; |
54 | 55 | ||
55 | /* | 56 | /* |
diff --git a/arch/mips/loongson/common/dma-swiotlb.c b/arch/mips/loongson/common/dma-swiotlb.c index c2be01f91575..2c6b989c1bc4 100644 --- a/arch/mips/loongson/common/dma-swiotlb.c +++ b/arch/mips/loongson/common/dma-swiotlb.c | |||
@@ -105,11 +105,25 @@ static int loongson_dma_set_mask(struct device *dev, u64 mask) | |||
105 | 105 | ||
106 | dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | 106 | dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
107 | { | 107 | { |
108 | long nid; | ||
109 | #ifdef CONFIG_PHYS48_TO_HT40 | ||
110 | /* We extract 2bit node id (bit 44~47, only bit 44~45 used now) from | ||
111 | * Loongson-3's 48bit address space and embed it into 40bit */ | ||
112 | nid = (paddr >> 44) & 0x3; | ||
113 | paddr = ((nid << 44) ^ paddr) | (nid << 37); | ||
114 | #endif | ||
108 | return paddr; | 115 | return paddr; |
109 | } | 116 | } |
110 | 117 | ||
111 | phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) | 118 | phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) |
112 | { | 119 | { |
120 | long nid; | ||
121 | #ifdef CONFIG_PHYS48_TO_HT40 | ||
122 | /* We extract 2bit node id (bit 44~47, only bit 44~45 used now) from | ||
123 | * Loongson-3's 48bit address space and embed it into 40bit */ | ||
124 | nid = (daddr >> 37) & 0x3; | ||
125 | daddr = ((nid << 37) ^ daddr) | (nid << 44); | ||
126 | #endif | ||
113 | return daddr; | 127 | return daddr; |
114 | } | 128 | } |
115 | 129 | ||
diff --git a/arch/mips/loongson/common/early_printk.c b/arch/mips/loongson/common/early_printk.c index ced461b39069..6ca632e529dc 100644 --- a/arch/mips/loongson/common/early_printk.c +++ b/arch/mips/loongson/common/early_printk.c | |||
@@ -30,7 +30,7 @@ void prom_putchar(char c) | |||
30 | int timeout; | 30 | int timeout; |
31 | unsigned char *uart_base; | 31 | unsigned char *uart_base; |
32 | 32 | ||
33 | uart_base = (unsigned char *)_loongson_uart_base; | 33 | uart_base = (unsigned char *)_loongson_uart_base[0]; |
34 | timeout = 1024; | 34 | timeout = 1024; |
35 | 35 | ||
36 | while (((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0) && | 36 | while (((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0) && |
diff --git a/arch/mips/loongson/common/env.c b/arch/mips/loongson/common/env.c index f15228550a22..045ea3d47c87 100644 --- a/arch/mips/loongson/common/env.c +++ b/arch/mips/loongson/common/env.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/bootinfo.h> | 21 | #include <asm/bootinfo.h> |
22 | #include <loongson.h> | 22 | #include <loongson.h> |
23 | #include <boot_param.h> | 23 | #include <boot_param.h> |
24 | #include <workarounds.h> | ||
24 | 25 | ||
25 | u32 cpu_clock_freq; | 26 | u32 cpu_clock_freq; |
26 | EXPORT_SYMBOL(cpu_clock_freq); | 27 | EXPORT_SYMBOL(cpu_clock_freq); |
@@ -31,7 +32,6 @@ u64 loongson_chipcfg[MAX_PACKAGES] = {0xffffffffbfc00180}; | |||
31 | u64 loongson_freqctrl[MAX_PACKAGES]; | 32 | u64 loongson_freqctrl[MAX_PACKAGES]; |
32 | 33 | ||
33 | unsigned long long smp_group[4]; | 34 | unsigned long long smp_group[4]; |
34 | int cpuhotplug_workaround = 0; | ||
35 | 35 | ||
36 | #define parse_even_earlier(res, option, p) \ | 36 | #define parse_even_earlier(res, option, p) \ |
37 | do { \ | 37 | do { \ |
@@ -67,6 +67,7 @@ void __init prom_init_env(void) | |||
67 | #else | 67 | #else |
68 | struct boot_params *boot_p; | 68 | struct boot_params *boot_p; |
69 | struct loongson_params *loongson_p; | 69 | struct loongson_params *loongson_p; |
70 | struct system_loongson *esys; | ||
70 | struct efi_cpuinfo_loongson *ecpu; | 71 | struct efi_cpuinfo_loongson *ecpu; |
71 | struct irq_source_routing_table *eirq_source; | 72 | struct irq_source_routing_table *eirq_source; |
72 | 73 | ||
@@ -74,6 +75,8 @@ void __init prom_init_env(void) | |||
74 | boot_p = (struct boot_params *)fw_arg2; | 75 | boot_p = (struct boot_params *)fw_arg2; |
75 | loongson_p = &(boot_p->efi.smbios.lp); | 76 | loongson_p = &(boot_p->efi.smbios.lp); |
76 | 77 | ||
78 | esys = (struct system_loongson *) | ||
79 | ((u64)loongson_p + loongson_p->system_offset); | ||
77 | ecpu = (struct efi_cpuinfo_loongson *) | 80 | ecpu = (struct efi_cpuinfo_loongson *) |
78 | ((u64)loongson_p + loongson_p->cpu_offset); | 81 | ((u64)loongson_p + loongson_p->cpu_offset); |
79 | eirq_source = (struct irq_source_routing_table *) | 82 | eirq_source = (struct irq_source_routing_table *) |
@@ -95,6 +98,7 @@ void __init prom_init_env(void) | |||
95 | loongson_chipcfg[2] = 0x900020001fe00180; | 98 | loongson_chipcfg[2] = 0x900020001fe00180; |
96 | loongson_chipcfg[3] = 0x900030001fe00180; | 99 | loongson_chipcfg[3] = 0x900030001fe00180; |
97 | loongson_sysconf.ht_control_base = 0x90000EFDFB000000; | 100 | loongson_sysconf.ht_control_base = 0x90000EFDFB000000; |
101 | loongson_sysconf.workarounds = WORKAROUND_CPUFREQ; | ||
98 | } else if (ecpu->cputype == Loongson_3B) { | 102 | } else if (ecpu->cputype == Loongson_3B) { |
99 | loongson_sysconf.cores_per_node = 4; /* One chip has 2 nodes */ | 103 | loongson_sysconf.cores_per_node = 4; /* One chip has 2 nodes */ |
100 | loongson_sysconf.cores_per_package = 8; | 104 | loongson_sysconf.cores_per_package = 8; |
@@ -111,7 +115,7 @@ void __init prom_init_env(void) | |||
111 | loongson_freqctrl[2] = 0x900040001fe001d0; | 115 | loongson_freqctrl[2] = 0x900040001fe001d0; |
112 | loongson_freqctrl[3] = 0x900060001fe001d0; | 116 | loongson_freqctrl[3] = 0x900060001fe001d0; |
113 | loongson_sysconf.ht_control_base = 0x90001EFDFB000000; | 117 | loongson_sysconf.ht_control_base = 0x90001EFDFB000000; |
114 | cpuhotplug_workaround = 1; | 118 | loongson_sysconf.workarounds = WORKAROUND_CPUHOTPLUG; |
115 | } else { | 119 | } else { |
116 | loongson_sysconf.cores_per_node = 1; | 120 | loongson_sysconf.cores_per_node = 1; |
117 | loongson_sysconf.cores_per_package = 1; | 121 | loongson_sysconf.cores_per_package = 1; |
@@ -119,6 +123,8 @@ void __init prom_init_env(void) | |||
119 | } | 123 | } |
120 | 124 | ||
121 | loongson_sysconf.nr_cpus = ecpu->nr_cpus; | 125 | loongson_sysconf.nr_cpus = ecpu->nr_cpus; |
126 | loongson_sysconf.boot_cpu_id = ecpu->cpu_startup_core_id; | ||
127 | loongson_sysconf.reserved_cpus_mask = ecpu->reserved_cores_mask; | ||
122 | if (ecpu->nr_cpus > NR_CPUS || ecpu->nr_cpus == 0) | 128 | if (ecpu->nr_cpus > NR_CPUS || ecpu->nr_cpus == 0) |
123 | loongson_sysconf.nr_cpus = NR_CPUS; | 129 | loongson_sysconf.nr_cpus = NR_CPUS; |
124 | loongson_sysconf.nr_nodes = (loongson_sysconf.nr_cpus + | 130 | loongson_sysconf.nr_nodes = (loongson_sysconf.nr_cpus + |
@@ -141,6 +147,24 @@ void __init prom_init_env(void) | |||
141 | pr_debug("Shutdown Addr: %llx, Restart Addr: %llx, VBIOS Addr: %llx\n", | 147 | pr_debug("Shutdown Addr: %llx, Restart Addr: %llx, VBIOS Addr: %llx\n", |
142 | loongson_sysconf.poweroff_addr, loongson_sysconf.restart_addr, | 148 | loongson_sysconf.poweroff_addr, loongson_sysconf.restart_addr, |
143 | loongson_sysconf.vgabios_addr); | 149 | loongson_sysconf.vgabios_addr); |
150 | |||
151 | memset(loongson_sysconf.ecname, 0, 32); | ||
152 | if (esys->has_ec) | ||
153 | memcpy(loongson_sysconf.ecname, esys->ec_name, 32); | ||
154 | loongson_sysconf.workarounds |= esys->workarounds; | ||
155 | |||
156 | loongson_sysconf.nr_uarts = esys->nr_uarts; | ||
157 | if (esys->nr_uarts < 1 || esys->nr_uarts > MAX_UARTS) | ||
158 | loongson_sysconf.nr_uarts = 1; | ||
159 | memcpy(loongson_sysconf.uarts, esys->uarts, | ||
160 | sizeof(struct uart_device) * loongson_sysconf.nr_uarts); | ||
161 | |||
162 | loongson_sysconf.nr_sensors = esys->nr_sensors; | ||
163 | if (loongson_sysconf.nr_sensors > MAX_SENSORS) | ||
164 | loongson_sysconf.nr_sensors = 0; | ||
165 | if (loongson_sysconf.nr_sensors) | ||
166 | memcpy(loongson_sysconf.sensors, esys->sensors, | ||
167 | sizeof(struct sensor_device) * loongson_sysconf.nr_sensors); | ||
144 | #endif | 168 | #endif |
145 | if (cpu_clock_freq == 0) { | 169 | if (cpu_clock_freq == 0) { |
146 | processor_id = (¤t_cpu_data)->processor_id; | 170 | processor_id = (¤t_cpu_data)->processor_id; |
diff --git a/arch/mips/loongson/common/gpio.c b/arch/mips/loongson/common/gpio.c index 21869908aaa4..29dbaa253061 100644 --- a/arch/mips/loongson/common/gpio.c +++ b/arch/mips/loongson/common/gpio.c | |||
@@ -37,7 +37,7 @@ int gpio_get_value(unsigned gpio) | |||
37 | val = LOONGSON_GPIODATA; | 37 | val = LOONGSON_GPIODATA; |
38 | spin_unlock(&gpio_lock); | 38 | spin_unlock(&gpio_lock); |
39 | 39 | ||
40 | return ((val & mask) != 0); | 40 | return (val & mask) != 0; |
41 | } | 41 | } |
42 | EXPORT_SYMBOL(gpio_get_value); | 42 | EXPORT_SYMBOL(gpio_get_value); |
43 | 43 | ||
diff --git a/arch/mips/loongson/common/init.c b/arch/mips/loongson/common/init.c index f6af3aba4c86..9b987fe98b5b 100644 --- a/arch/mips/loongson/common/init.c +++ b/arch/mips/loongson/common/init.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <asm/bootinfo.h> | ||
12 | #include <asm/smp-ops.h> | 13 | #include <asm/smp-ops.h> |
13 | 14 | ||
14 | #include <loongson.h> | 15 | #include <loongson.h> |
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c index 1a4797984b8d..f2807bc662a3 100644 --- a/arch/mips/loongson/common/machtype.c +++ b/arch/mips/loongson/common/machtype.c | |||
@@ -19,19 +19,16 @@ | |||
19 | #define MACHTYPE_LEN 50 | 19 | #define MACHTYPE_LEN 50 |
20 | 20 | ||
21 | static const char *system_types[] = { | 21 | static const char *system_types[] = { |
22 | [MACH_LOONGSON_UNKNOWN] "unknown loongson machine", | 22 | [MACH_LOONGSON_UNKNOWN] = "unknown loongson machine", |
23 | [MACH_LEMOTE_FL2E] "lemote-fuloong-2e-box", | 23 | [MACH_LEMOTE_FL2E] = "lemote-fuloong-2e-box", |
24 | [MACH_LEMOTE_FL2F] "lemote-fuloong-2f-box", | 24 | [MACH_LEMOTE_FL2F] = "lemote-fuloong-2f-box", |
25 | [MACH_LEMOTE_ML2F7] "lemote-mengloong-2f-7inches", | 25 | [MACH_LEMOTE_ML2F7] = "lemote-mengloong-2f-7inches", |
26 | [MACH_LEMOTE_YL2F89] "lemote-yeeloong-2f-8.9inches", | 26 | [MACH_LEMOTE_YL2F89] = "lemote-yeeloong-2f-8.9inches", |
27 | [MACH_DEXXON_GDIUM2F10] "dexxon-gdium-2f", | 27 | [MACH_DEXXON_GDIUM2F10] = "dexxon-gdium-2f", |
28 | [MACH_LEMOTE_NAS] "lemote-nas-2f", | 28 | [MACH_LEMOTE_NAS] = "lemote-nas-2f", |
29 | [MACH_LEMOTE_LL2F] "lemote-lynloong-2f", | 29 | [MACH_LEMOTE_LL2F] = "lemote-lynloong-2f", |
30 | [MACH_LEMOTE_A1004] "lemote-3a-notebook-a1004", | 30 | [MACH_LOONGSON_GENERIC] = "generic-loongson-machine", |
31 | [MACH_LEMOTE_A1101] "lemote-3a-itx-a1101", | 31 | [MACH_LOONGSON_END] = NULL, |
32 | [MACH_LEMOTE_A1201] "lemote-2gq-notebook-a1201", | ||
33 | [MACH_LEMOTE_A1205] "lemote-2gq-aio-a1205", | ||
34 | [MACH_LOONGSON_END] NULL, | ||
35 | }; | 32 | }; |
36 | 33 | ||
37 | const char *get_system_type(void) | 34 | const char *get_system_type(void) |
diff --git a/arch/mips/loongson/common/rtc.c b/arch/mips/loongson/common/rtc.c index a90d87c01555..b5709af09f7f 100644 --- a/arch/mips/loongson/common/rtc.c +++ b/arch/mips/loongson/common/rtc.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/mc146818rtc.h> | 15 | #include <linux/mc146818rtc.h> |
16 | 16 | ||
17 | struct resource loongson_rtc_resources[] = { | 17 | static struct resource loongson_rtc_resources[] = { |
18 | { | 18 | { |
19 | .start = RTC_PORT(0), | 19 | .start = RTC_PORT(0), |
20 | .end = RTC_PORT(1), | 20 | .end = RTC_PORT(1), |
diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c index bd2b7095b6dc..c23fa1373729 100644 --- a/arch/mips/loongson/common/serial.c +++ b/arch/mips/loongson/common/serial.c | |||
@@ -38,20 +38,17 @@ | |||
38 | .regshift = 0, \ | 38 | .regshift = 0, \ |
39 | } | 39 | } |
40 | 40 | ||
41 | static struct plat_serial8250_port uart8250_data[][2] = { | 41 | static struct plat_serial8250_port uart8250_data[][MAX_UARTS + 1] = { |
42 | [MACH_LOONGSON_UNKNOWN] {}, | 42 | [MACH_LOONGSON_UNKNOWN] = {}, |
43 | [MACH_LEMOTE_FL2E] {PORT(4, 1843200), {} }, | 43 | [MACH_LEMOTE_FL2E] = {PORT(4, 1843200), {} }, |
44 | [MACH_LEMOTE_FL2F] {PORT(3, 1843200), {} }, | 44 | [MACH_LEMOTE_FL2F] = {PORT(3, 1843200), {} }, |
45 | [MACH_LEMOTE_ML2F7] {PORT_M(3, 3686400), {} }, | 45 | [MACH_LEMOTE_ML2F7] = {PORT_M(3, 3686400), {} }, |
46 | [MACH_LEMOTE_YL2F89] {PORT_M(3, 3686400), {} }, | 46 | [MACH_LEMOTE_YL2F89] = {PORT_M(3, 3686400), {} }, |
47 | [MACH_DEXXON_GDIUM2F10] {PORT_M(3, 3686400), {} }, | 47 | [MACH_DEXXON_GDIUM2F10] = {PORT_M(3, 3686400), {} }, |
48 | [MACH_LEMOTE_NAS] {PORT_M(3, 3686400), {} }, | 48 | [MACH_LEMOTE_NAS] = {PORT_M(3, 3686400), {} }, |
49 | [MACH_LEMOTE_LL2F] {PORT(3, 1843200), {} }, | 49 | [MACH_LEMOTE_LL2F] = {PORT(3, 1843200), {} }, |
50 | [MACH_LEMOTE_A1004] {PORT_M(2, 33177600), {} }, | 50 | [MACH_LOONGSON_GENERIC] = {PORT_M(2, 25000000), {} }, |
51 | [MACH_LEMOTE_A1101] {PORT_M(2, 25000000), {} }, | 51 | [MACH_LOONGSON_END] = {}, |
52 | [MACH_LEMOTE_A1201] {PORT_M(2, 25000000), {} }, | ||
53 | [MACH_LEMOTE_A1205] {PORT_M(2, 25000000), {} }, | ||
54 | [MACH_LOONGSON_END] {}, | ||
55 | }; | 52 | }; |
56 | 53 | ||
57 | static struct platform_device uart8250_device = { | 54 | static struct platform_device uart8250_device = { |
@@ -61,17 +58,52 @@ static struct platform_device uart8250_device = { | |||
61 | 58 | ||
62 | static int __init serial_init(void) | 59 | static int __init serial_init(void) |
63 | { | 60 | { |
61 | int i; | ||
64 | unsigned char iotype; | 62 | unsigned char iotype; |
65 | 63 | ||
66 | iotype = uart8250_data[mips_machtype][0].iotype; | 64 | iotype = uart8250_data[mips_machtype][0].iotype; |
67 | 65 | ||
68 | if (UPIO_MEM == iotype) | 66 | if (UPIO_MEM == iotype) { |
67 | uart8250_data[mips_machtype][0].mapbase = | ||
68 | loongson_uart_base[0]; | ||
69 | uart8250_data[mips_machtype][0].membase = | 69 | uart8250_data[mips_machtype][0].membase = |
70 | (void __iomem *)_loongson_uart_base; | 70 | (void __iomem *)_loongson_uart_base[0]; |
71 | } | ||
71 | else if (UPIO_PORT == iotype) | 72 | else if (UPIO_PORT == iotype) |
72 | uart8250_data[mips_machtype][0].iobase = | 73 | uart8250_data[mips_machtype][0].iobase = |
73 | loongson_uart_base - LOONGSON_PCIIO_BASE; | 74 | loongson_uart_base[0] - LOONGSON_PCIIO_BASE; |
74 | 75 | ||
76 | if (loongson_sysconf.uarts[0].uartclk) | ||
77 | uart8250_data[mips_machtype][0].uartclk = | ||
78 | loongson_sysconf.uarts[0].uartclk; | ||
79 | |||
80 | for (i = 1; i < loongson_sysconf.nr_uarts; i++) { | ||
81 | iotype = loongson_sysconf.uarts[i].iotype; | ||
82 | uart8250_data[mips_machtype][i].iotype = iotype; | ||
83 | loongson_uart_base[i] = loongson_sysconf.uarts[i].uart_base; | ||
84 | |||
85 | if (UPIO_MEM == iotype) { | ||
86 | uart8250_data[mips_machtype][i].irq = | ||
87 | MIPS_CPU_IRQ_BASE + loongson_sysconf.uarts[i].int_offset; | ||
88 | uart8250_data[mips_machtype][i].mapbase = | ||
89 | loongson_uart_base[i]; | ||
90 | uart8250_data[mips_machtype][i].membase = | ||
91 | ioremap_nocache(loongson_uart_base[i], 8); | ||
92 | } else if (UPIO_PORT == iotype) { | ||
93 | uart8250_data[mips_machtype][i].irq = | ||
94 | loongson_sysconf.uarts[i].int_offset; | ||
95 | uart8250_data[mips_machtype][i].iobase = | ||
96 | loongson_uart_base[i] - LOONGSON_PCIIO_BASE; | ||
97 | } | ||
98 | |||
99 | uart8250_data[mips_machtype][i].uartclk = | ||
100 | loongson_sysconf.uarts[i].uartclk; | ||
101 | uart8250_data[mips_machtype][i].flags = | ||
102 | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; | ||
103 | } | ||
104 | |||
105 | memset(&uart8250_data[mips_machtype][loongson_sysconf.nr_uarts], | ||
106 | 0, sizeof(struct plat_serial8250_port)); | ||
75 | uart8250_device.dev.platform_data = uart8250_data[mips_machtype]; | 107 | uart8250_device.dev.platform_data = uart8250_data[mips_machtype]; |
76 | 108 | ||
77 | return platform_device_register(&uart8250_device); | 109 | return platform_device_register(&uart8250_device); |
diff --git a/arch/mips/loongson/common/setup.c b/arch/mips/loongson/common/setup.c index bb4ac922e47a..d477dd6bb326 100644 --- a/arch/mips/loongson/common/setup.c +++ b/arch/mips/loongson/common/setup.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | 11 | ||
12 | #include <asm/wbflush.h> | 12 | #include <asm/wbflush.h> |
13 | #include <asm/bootinfo.h> | ||
13 | 14 | ||
14 | #include <loongson.h> | 15 | #include <loongson.h> |
15 | 16 | ||
diff --git a/arch/mips/loongson/common/time.c b/arch/mips/loongson/common/time.c index 262a1f65b05e..e1a5382ad47e 100644 --- a/arch/mips/loongson/common/time.c +++ b/arch/mips/loongson/common/time.c | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | #include <asm/mc146818-time.h> | 13 | #include <asm/mc146818-time.h> |
14 | #include <asm/time.h> | 14 | #include <asm/time.h> |
15 | #include <asm/hpet.h> | ||
15 | 16 | ||
16 | #include <loongson.h> | 17 | #include <loongson.h> |
17 | #include <cs5536/cs5536_mfgpt.h> | 18 | #include <cs5536/cs5536_mfgpt.h> |
@@ -21,7 +22,11 @@ void __init plat_time_init(void) | |||
21 | /* setup mips r4k timer */ | 22 | /* setup mips r4k timer */ |
22 | mips_hpt_frequency = cpu_clock_freq / 2; | 23 | mips_hpt_frequency = cpu_clock_freq / 2; |
23 | 24 | ||
25 | #ifdef CONFIG_RS780_HPET | ||
26 | setup_hpet_timer(); | ||
27 | #else | ||
24 | setup_mfgpt0_timer(); | 28 | setup_mfgpt0_timer(); |
29 | #endif | ||
25 | } | 30 | } |
26 | 31 | ||
27 | void read_persistent_clock(struct timespec *ts) | 32 | void read_persistent_clock(struct timespec *ts) |
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c index 1e1eeea73fde..9de559d58e1f 100644 --- a/arch/mips/loongson/common/uart_base.c +++ b/arch/mips/loongson/common/uart_base.c | |||
@@ -13,22 +13,27 @@ | |||
13 | 13 | ||
14 | #include <loongson.h> | 14 | #include <loongson.h> |
15 | 15 | ||
16 | /* ioremapped */ | ||
17 | unsigned long _loongson_uart_base; | ||
18 | EXPORT_SYMBOL(_loongson_uart_base); | ||
19 | /* raw */ | 16 | /* raw */ |
20 | unsigned long loongson_uart_base; | 17 | unsigned long loongson_uart_base[MAX_UARTS] = {}; |
18 | /* ioremapped */ | ||
19 | unsigned long _loongson_uart_base[MAX_UARTS] = {}; | ||
20 | |||
21 | EXPORT_SYMBOL(loongson_uart_base); | 21 | EXPORT_SYMBOL(loongson_uart_base); |
22 | EXPORT_SYMBOL(_loongson_uart_base); | ||
22 | 23 | ||
23 | void prom_init_loongson_uart_base(void) | 24 | void prom_init_loongson_uart_base(void) |
24 | { | 25 | { |
25 | switch (mips_machtype) { | 26 | switch (mips_machtype) { |
27 | case MACH_LOONGSON_GENERIC: | ||
28 | /* The CPU provided serial port (CPU) */ | ||
29 | loongson_uart_base[0] = LOONGSON_REG_BASE + 0x1e0; | ||
30 | break; | ||
26 | case MACH_LEMOTE_FL2E: | 31 | case MACH_LEMOTE_FL2E: |
27 | loongson_uart_base = LOONGSON_PCIIO_BASE + 0x3f8; | 32 | loongson_uart_base[0] = LOONGSON_PCIIO_BASE + 0x3f8; |
28 | break; | 33 | break; |
29 | case MACH_LEMOTE_FL2F: | 34 | case MACH_LEMOTE_FL2F: |
30 | case MACH_LEMOTE_LL2F: | 35 | case MACH_LEMOTE_LL2F: |
31 | loongson_uart_base = LOONGSON_PCIIO_BASE + 0x2f8; | 36 | loongson_uart_base[0] = LOONGSON_PCIIO_BASE + 0x2f8; |
32 | break; | 37 | break; |
33 | case MACH_LEMOTE_ML2F7: | 38 | case MACH_LEMOTE_ML2F7: |
34 | case MACH_LEMOTE_YL2F89: | 39 | case MACH_LEMOTE_YL2F89: |
@@ -36,17 +41,10 @@ void prom_init_loongson_uart_base(void) | |||
36 | case MACH_LEMOTE_NAS: | 41 | case MACH_LEMOTE_NAS: |
37 | default: | 42 | default: |
38 | /* The CPU provided serial port (LPC) */ | 43 | /* The CPU provided serial port (LPC) */ |
39 | loongson_uart_base = LOONGSON_LIO1_BASE + 0x3f8; | 44 | loongson_uart_base[0] = LOONGSON_LIO1_BASE + 0x3f8; |
40 | break; | ||
41 | case MACH_LEMOTE_A1004: | ||
42 | case MACH_LEMOTE_A1101: | ||
43 | case MACH_LEMOTE_A1201: | ||
44 | case MACH_LEMOTE_A1205: | ||
45 | /* The CPU provided serial port (CPU) */ | ||
46 | loongson_uart_base = LOONGSON_REG_BASE + 0x1e0; | ||
47 | break; | 45 | break; |
48 | } | 46 | } |
49 | 47 | ||
50 | _loongson_uart_base = | 48 | _loongson_uart_base[0] = |
51 | (unsigned long)ioremap_nocache(loongson_uart_base, 8); | 49 | (unsigned long)ioremap_nocache(loongson_uart_base[0], 8); |
52 | } | 50 | } |