forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add common code for Atheros AR5312 and Atheros AR2315 SoCs families. Signed-off-by: Sergey Ryazanov <[email protected]> Cc: Linux MIPS <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/8237 Signed-off-by: Ralf Baechle <[email protected]>
- Loading branch information
1 parent
484c344
commit 43cc739
Showing
12 changed files
with
296 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# This file is subject to the terms and conditions of the GNU General Public | ||
# License. See the file "COPYING" in the main directory of this archive | ||
# for more details. | ||
# | ||
# Copyright (C) 2006 FON Technology, SL. | ||
# Copyright (C) 2006 Imre Kaloz <[email protected]> | ||
# Copyright (C) 2006-2009 Felix Fietkau <[email protected]> | ||
# | ||
|
||
obj-y += board.o prom.o devices.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Atheros AR531X/AR231X WiSoC | ||
# | ||
platform-$(CONFIG_ATH25) += ath25/ | ||
cflags-$(CONFIG_ATH25) += -I$(srctree)/arch/mips/include/asm/mach-ath25 | ||
load-$(CONFIG_ATH25) += 0xffffffff80041000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. | ||
* Copyright (C) 2006 FON Technology, SL. | ||
* Copyright (C) 2006 Imre Kaloz <[email protected]> | ||
* Copyright (C) 2006-2009 Felix Fietkau <[email protected]> | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/interrupt.h> | ||
#include <asm/irq_cpu.h> | ||
#include <asm/reboot.h> | ||
#include <asm/bootinfo.h> | ||
#include <asm/time.h> | ||
|
||
static void ath25_halt(void) | ||
{ | ||
local_irq_disable(); | ||
unreachable(); | ||
} | ||
|
||
void __init plat_mem_setup(void) | ||
{ | ||
_machine_halt = ath25_halt; | ||
pm_power_off = ath25_halt; | ||
|
||
/* Disable data watchpoints */ | ||
write_c0_watchlo0(0); | ||
} | ||
|
||
asmlinkage void plat_irq_dispatch(void) | ||
{ | ||
} | ||
|
||
void __init plat_time_init(void) | ||
{ | ||
} | ||
|
||
unsigned int __cpuinit get_c0_compare_int(void) | ||
{ | ||
return CP0_LEGACY_COMPARE_IRQ; | ||
} | ||
|
||
void __init arch_init_irq(void) | ||
{ | ||
clear_c0_status(ST0_IM); | ||
mips_cpu_irq_init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <asm/bootinfo.h> | ||
|
||
#include "devices.h" | ||
|
||
const char *get_system_type(void) | ||
{ | ||
return "Atheros (unknown)"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef __ATH25_DEVICES_H | ||
#define __ATH25_DEVICES_H | ||
|
||
#include <linux/cpu.h> | ||
|
||
#define ATH25_REG_MS(_val, _field) (((_val) & _field##_M) >> _field##_S) | ||
|
||
static inline bool is_ar2315(void) | ||
{ | ||
return (current_cpu_data.cputype == CPU_4KEC); | ||
} | ||
|
||
static inline bool is_ar5312(void) | ||
{ | ||
return !is_ar2315(); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* Copyright MontaVista Software Inc | ||
* Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. | ||
* Copyright (C) 2006 FON Technology, SL. | ||
* Copyright (C) 2006 Imre Kaloz <[email protected]> | ||
* Copyright (C) 2006 Felix Fietkau <[email protected]> | ||
*/ | ||
|
||
/* | ||
* Prom setup file for AR5312/AR231x SoCs | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <asm/bootinfo.h> | ||
|
||
void __init prom_init(void) | ||
{ | ||
} | ||
|
||
void __init prom_free_prom_memory(void) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Atheros AR231x/AR531x SoC specific CPU feature overrides | ||
* | ||
* Copyright (C) 2008 Gabor Juhos <[email protected]> | ||
* | ||
* This file was derived from: include/asm-mips/cpu-features.h | ||
* Copyright (C) 2003, 2004 Ralf Baechle | ||
* Copyright (C) 2004 Maciej W. Rozycki | ||
* | ||
* 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. | ||
* | ||
*/ | ||
#ifndef __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H | ||
#define __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H | ||
|
||
/* | ||
* The Atheros AR531x/AR231x SoCs have MIPS 4Kc/4KEc core. | ||
*/ | ||
#define cpu_has_tlb 1 | ||
#define cpu_has_4kex 1 | ||
#define cpu_has_3k_cache 0 | ||
#define cpu_has_4k_cache 1 | ||
#define cpu_has_tx39_cache 0 | ||
#define cpu_has_sb1_cache 0 | ||
#define cpu_has_fpu 0 | ||
#define cpu_has_32fpr 0 | ||
#define cpu_has_counter 1 | ||
#define cpu_has_ejtag 1 | ||
|
||
/* | ||
* The MIPS 4Kc V0.9 core in the AR5312/AR2312 have problems with the | ||
* ll/sc instructions. | ||
*/ | ||
#define cpu_has_llsc 0 | ||
|
||
#define cpu_has_mips16 0 | ||
#define cpu_has_mdmx 0 | ||
#define cpu_has_mips3d 0 | ||
#define cpu_has_smartmips 0 | ||
|
||
#define cpu_has_mips32r1 1 | ||
|
||
#define cpu_has_mips64r1 0 | ||
#define cpu_has_mips64r2 0 | ||
|
||
#define cpu_has_dsp 0 | ||
#define cpu_has_mipsmt 0 | ||
|
||
#define cpu_has_64bits 0 | ||
#define cpu_has_64bit_zero_reg 0 | ||
#define cpu_has_64bit_gp_regs 0 | ||
#define cpu_has_64bit_addresses 0 | ||
|
||
#endif /* __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* Copyright (C) 2006 Ralf Baechle <[email protected]> | ||
* Copyright (C) 2007 Felix Fietkau <[email protected]> | ||
* | ||
*/ | ||
#ifndef __ASM_MACH_ATH25_DMA_COHERENCE_H | ||
#define __ASM_MACH_ATH25_DMA_COHERENCE_H | ||
|
||
#include <linux/device.h> | ||
|
||
static inline dma_addr_t | ||
plat_map_dma_mem(struct device *dev, void *addr, size_t size) | ||
{ | ||
return virt_to_phys(addr); | ||
} | ||
|
||
static inline dma_addr_t | ||
plat_map_dma_mem_page(struct device *dev, struct page *page) | ||
{ | ||
return page_to_phys(page); | ||
} | ||
|
||
static inline unsigned long | ||
plat_dma_addr_to_phys(struct device *dev, dma_addr_t dma_addr) | ||
{ | ||
return dma_addr; | ||
} | ||
|
||
static inline void | ||
plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
enum dma_data_direction direction) | ||
{ | ||
} | ||
|
||
static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
{ | ||
return 1; | ||
} | ||
|
||
static inline void plat_extra_sync_for_device(struct device *dev) | ||
{ | ||
} | ||
|
||
static inline int plat_dma_mapping_error(struct device *dev, | ||
dma_addr_t dma_addr) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline int plat_device_is_coherent(struct device *dev) | ||
{ | ||
#ifdef CONFIG_DMA_COHERENT | ||
return 1; | ||
#endif | ||
#ifdef CONFIG_DMA_NONCOHERENT | ||
return 0; | ||
#endif | ||
} | ||
|
||
#endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef __ASM_MACH_ATH25_GPIO_H | ||
#define __ASM_MACH_ATH25_GPIO_H | ||
|
||
#include <asm-generic/gpio.h> | ||
|
||
#define gpio_get_value __gpio_get_value | ||
#define gpio_set_value __gpio_set_value | ||
#define gpio_cansleep __gpio_cansleep | ||
#define gpio_to_irq __gpio_to_irq | ||
|
||
static inline int irq_to_gpio(unsigned irq) | ||
{ | ||
return -EINVAL; | ||
} | ||
|
||
#endif /* __ASM_MACH_ATH25_GPIO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* Copyright (C) 2008 Felix Fietkau <[email protected]> | ||
*/ | ||
#ifndef __ASM_MACH_ATH25_WAR_H | ||
#define __ASM_MACH_ATH25_WAR_H | ||
|
||
#define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
#define R4600_V1_HIT_CACHEOP_WAR 0 | ||
#define R4600_V2_HIT_CACHEOP_WAR 0 | ||
#define R5432_CP0_INTERRUPT_WAR 0 | ||
#define BCM1250_M3_WAR 0 | ||
#define SIBYTE_1956_WAR 0 | ||
#define MIPS4K_ICACHE_REFILL_WAR 0 | ||
#define MIPS_CACHE_SYNC_WAR 0 | ||
#define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
#define RM9000_CDEX_SMP_WAR 0 | ||
#define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
#define R10000_LLSC_WAR 0 | ||
#define MIPS34K_MISSED_ITLB_WAR 0 | ||
|
||
#endif /* __ASM_MACH_ATH25_WAR_H */ |