-
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.
- Loading branch information
Jayachandran C
authored and
Ralf Baechle
committed
Dec 7, 2011
1 parent
9d4ebf6
commit 975489a
Showing
20 changed files
with
699 additions
and
442 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 99fb2f7984726ba03d5634df8e6d26eb891f1ec3 | ||
refs/heads/master: 0c9654072a6e15aa3da9b314f0c5c01e90938268 |
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 @@ | ||
/* | ||
* Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights | ||
* reserved. | ||
* | ||
* This software is available to you under a choice of one of two | ||
* licenses. You may choose to be licensed under the terms of the GNU | ||
* General Public License (GPL) Version 2, available from the file | ||
* COPYING in the main directory of this source tree, or the NetLogic | ||
* license below: | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR | ||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN | ||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef _NETLOGIC_COMMON_H_ | ||
#define _NETLOGIC_COMMON_H_ | ||
|
||
/* | ||
* Common SMP definitions | ||
*/ | ||
struct irq_desc; | ||
extern struct plat_smp_ops nlm_smp_ops; | ||
extern char nlm_reset_entry[], nlm_reset_entry_end[]; | ||
void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc); | ||
void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc); | ||
void nlm_smp_irq_init(void); | ||
void prom_pre_boot_secondary_cpus(void); | ||
int nlm_wakeup_secondary_cpus(u32 wakeup_mask); | ||
void nlm_boot_smp_nmi(void); | ||
|
||
/* | ||
* Misc. | ||
*/ | ||
extern unsigned long nlm_common_ebase; | ||
unsigned int nlm_get_cpu_frequency(void); | ||
#endif /* _NETLOGIC_COMMON_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,142 @@ | ||
/* | ||
* Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights | ||
* reserved. | ||
* | ||
* This software is available to you under a choice of one of two | ||
* licenses. You may choose to be licensed under the terms of the GNU | ||
* General Public License (GPL) Version 2, available from the file | ||
* COPYING in the main directory of this source tree, or the NetLogic | ||
* license below: | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR | ||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN | ||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef __NLM_HAL_HALDEFS_H__ | ||
#define __NLM_HAL_HALDEFS_H__ | ||
|
||
/* | ||
* This file contains platform specific memory mapped IO implementation | ||
* and will provide a way to read 32/64 bit memory mapped registers in | ||
* all ABIs | ||
*/ | ||
/* | ||
* For o32 compilation, we have to disable interrupts and enable KX bit to | ||
* access 64 bit addresses or data. | ||
* | ||
* We need to disable interrupts because we save just the lower 32 bits of | ||
* registers in interrupt handling. So if we get hit by an interrupt while | ||
* using the upper 32 bits of a register, we lose. | ||
*/ | ||
static inline uint32_t nlm_save_flags_kx(void) | ||
{ | ||
return change_c0_status(ST0_KX | ST0_IE, ST0_KX); | ||
} | ||
|
||
static inline uint32_t nlm_save_flags_cop2(void) | ||
{ | ||
return change_c0_status(ST0_CU2 | ST0_IE, ST0_CU2); | ||
} | ||
|
||
static inline void nlm_restore_flags(uint32_t sr) | ||
{ | ||
write_c0_status(sr); | ||
} | ||
|
||
/* | ||
* The n64 implementations are simple, the o32 implementations when they | ||
* are added, will have to disable interrupts and enable KX before doing | ||
* 64 bit ops. | ||
*/ | ||
static inline uint32_t | ||
nlm_read_reg(uint64_t base, uint32_t reg) | ||
{ | ||
volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg; | ||
|
||
return *addr; | ||
} | ||
|
||
static inline void | ||
nlm_write_reg(uint64_t base, uint32_t reg, uint32_t val) | ||
{ | ||
volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg; | ||
|
||
*addr = val; | ||
} | ||
|
||
static inline uint64_t | ||
nlm_read_reg64(uint64_t base, uint32_t reg) | ||
{ | ||
uint64_t addr = base + (reg >> 1) * sizeof(uint64_t); | ||
volatile uint64_t *ptr = (volatile uint64_t *)(long)addr; | ||
|
||
return *ptr; | ||
} | ||
|
||
static inline void | ||
nlm_write_reg64(uint64_t base, uint32_t reg, uint64_t val) | ||
{ | ||
uint64_t addr = base + (reg >> 1) * sizeof(uint64_t); | ||
volatile uint64_t *ptr = (volatile uint64_t *)(long)addr; | ||
|
||
*ptr = val; | ||
} | ||
|
||
/* | ||
* Routines to store 32/64 bit values to 64 bit addresses, | ||
* used when going thru XKPHYS to access registers | ||
*/ | ||
static inline uint32_t | ||
nlm_read_reg_xkphys(uint64_t base, uint32_t reg) | ||
{ | ||
return nlm_read_reg(base, reg); | ||
} | ||
|
||
static inline void | ||
nlm_write_reg_xkphys(uint64_t base, uint32_t reg, uint32_t val) | ||
{ | ||
nlm_write_reg(base, reg, val); | ||
} | ||
|
||
static inline uint64_t | ||
nlm_read_reg64_xkphys(uint64_t base, uint32_t reg) | ||
{ | ||
return nlm_read_reg64(base, reg); | ||
} | ||
|
||
static inline void | ||
nlm_write_reg64_xkphys(uint64_t base, uint32_t reg, uint64_t val) | ||
{ | ||
nlm_write_reg64(base, reg, val); | ||
} | ||
|
||
/* Location where IO base is mapped */ | ||
extern uint64_t nlm_io_base; | ||
|
||
static inline uint64_t | ||
nlm_mmio_base(uint32_t devoffset) | ||
{ | ||
return nlm_io_base + devoffset; | ||
} | ||
|
||
#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
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,2 @@ | ||
obj-$(CONFIG_NLM_COMMON) += common/ | ||
obj-$(CONFIG_CPU_XLR) += xlr/ |
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,3 @@ | ||
obj-y += irq.o time.o | ||
obj-$(CONFIG_SMP) += smp.o | ||
obj-$(CONFIG_EARLY_PRINTK) += earlycons.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
Oops, something went wrong.