-
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.
[ARM] msm: core platform support for ARCH_MSM7X00A
- core header files for arch-msm - Kconfig and Makefiles to enable ARCH_MSM7X00A builds - MSM7X00A specific arch_idle - peripheral iomap and irq number definitions Signed-off-by: Brian Swetland <swetland@google.com>
- Loading branch information
Brian Swetland
authored and
Russell King
committed
Jan 26, 2008
1 parent
9b73e76
commit 3042102
Showing
20 changed files
with
628 additions
and
1 deletion.
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,2 @@ | ||
obj-y += io.o idle.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,3 @@ | ||
zreladdr-y := 0x10008000 | ||
params_phys-y := 0x10000100 | ||
initrd_phys-y := 0x10800000 |
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,36 @@ | ||
/* linux/include/asm-arm/arch-msm/idle.S | ||
* | ||
* Idle processing for MSM7K - work around bugs with SWFI. | ||
* | ||
* Copyright (c) 2007 QUALCOMM Incorporated. | ||
* Copyright (C) 2007 Google, Inc. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
#include <linux/linkage.h> | ||
#include <asm/assembler.h> | ||
|
||
ENTRY(arch_idle) | ||
#ifdef CONFIG_MSM7X00A_IDLE | ||
mrc p15, 0, r1, c1, c0, 0 /* read current CR */ | ||
bic r0, r1, #(1 << 2) /* clear dcache bit */ | ||
bic r0, r0, #(1 << 12) /* clear icache bit */ | ||
mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */ | ||
|
||
mov r0, #0 /* prepare wfi value */ | ||
mcr p15, 0, r0, c7, c10, 0 /* flush the cache */ | ||
mcr p15, 0, r0, c7, c10, 4 /* memory barrier */ | ||
mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */ | ||
|
||
mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */ | ||
#endif | ||
mov pc, lr |
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,85 @@ | ||
/* arch/arm/mach-msm/io.c | ||
* | ||
* MSM7K io support | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* Author: Brian Swetland <swetland@google.com> | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
|
||
#include <asm/hardware.h> | ||
#include <asm/io.h> | ||
#include <asm/page.h> | ||
#include <asm/arch/msm_iomap.h> | ||
#include <asm/mach/map.h> | ||
|
||
#include <asm/arch/board.h> | ||
|
||
#define MSM_DEVICE(name) { \ | ||
.virtual = MSM_##name##_BASE, \ | ||
.pfn = __phys_to_pfn(MSM_##name##_PHYS), \ | ||
.length = MSM_##name##_SIZE, \ | ||
.type = MT_DEVICE_NONSHARED, \ | ||
} | ||
|
||
static struct map_desc msm_io_desc[] __initdata = { | ||
MSM_DEVICE(VIC), | ||
MSM_DEVICE(CSR), | ||
MSM_DEVICE(GPT), | ||
MSM_DEVICE(DMOV), | ||
MSM_DEVICE(UART1), | ||
MSM_DEVICE(UART2), | ||
MSM_DEVICE(UART3), | ||
MSM_DEVICE(I2C), | ||
MSM_DEVICE(GPIO1), | ||
MSM_DEVICE(GPIO2), | ||
MSM_DEVICE(HSUSB), | ||
MSM_DEVICE(CLK_CTL), | ||
MSM_DEVICE(PMDH), | ||
MSM_DEVICE(EMDH), | ||
MSM_DEVICE(MDP), | ||
{ | ||
.virtual = MSM_SHARED_RAM_BASE, | ||
.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS), | ||
.length = MSM_SHARED_RAM_SIZE, | ||
.type = MT_DEVICE, | ||
}, | ||
}; | ||
|
||
void __init msm_map_common_io(void) | ||
{ | ||
/* Make sure the peripheral register window is closed, since | ||
* we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which | ||
* pages are peripheral interface or not. | ||
*/ | ||
asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0)); | ||
|
||
iotable_init(msm_io_desc, ARRAY_SIZE(msm_io_desc)); | ||
} | ||
|
||
void __iomem * | ||
__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) | ||
{ | ||
if (mtype == MT_DEVICE) { | ||
/* The peripherals in the 88000000 - D0000000 range | ||
* are only accessable by type MT_DEVICE_NONSHARED. | ||
* Adjust mtype as necessary to make this "just work." | ||
*/ | ||
if ((phys_addr >= 0x88000000) && (phys_addr < 0xD0000000)) | ||
mtype = MT_DEVICE_NONSHARED; | ||
} | ||
|
||
return __arm_ioremap(phys_addr, size, mtype); | ||
} |
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,37 @@ | ||
/* linux/include/asm-arm/arch-msm/board.h | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* Author: Brian Swetland <swetland@google.com> | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#ifndef __ASM_ARCH_MSM_BOARD_H | ||
#define __ASM_ARCH_MSM_BOARD_H | ||
|
||
#include <linux/types.h> | ||
|
||
/* platform device data structures */ | ||
|
||
struct msm_mddi_platform_data | ||
{ | ||
void (*panel_power)(int on); | ||
unsigned has_vsync_irq:1; | ||
}; | ||
|
||
/* common init routines for use by arch/arm/mach-msm/board-*.c */ | ||
|
||
void __init msm_add_devices(void); | ||
void __init msm_map_common_io(void); | ||
void __init msm_init_irq(void); | ||
void __init msm_init_gpio(void); | ||
|
||
#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,40 @@ | ||
/* include/asm-arm/arch-msm7200/debug-macro.S | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* Author: Brian Swetland <swetland@google.com> | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#include <asm/hardware.h> | ||
#include <asm/arch/msm_iomap.h> | ||
|
||
.macro addruart,rx | ||
@ see if the MMU is enabled and select appropriate base address | ||
mrc p15, 0, \rx, c1, c0 | ||
tst \rx, #1 | ||
ldreq \rx, =MSM_UART1_PHYS | ||
ldrne \rx, =MSM_UART1_BASE | ||
.endm | ||
|
||
.macro senduart,rd,rx | ||
str \rd, [\rx, #0x0C] | ||
.endm | ||
|
||
.macro waituart,rd,rx | ||
@ wait for TX_READY | ||
1: ldr \rd, [\rx, #0x08] | ||
tst \rd, #0x04 | ||
beq 1b | ||
.endm | ||
|
||
.macro busyuart,rd,rx | ||
.endm |
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 @@ | ||
|
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,38 @@ | ||
/* include/asm-arm/arch-msm7200/entry-macro.S | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* Author: Brian Swetland <swetland@google.com> | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#include <asm/arch/msm_iomap.h> | ||
|
||
.macro disable_fiq | ||
.endm | ||
|
||
.macro get_irqnr_preamble, base, tmp | ||
@ enable imprecise aborts | ||
cpsie a | ||
mov \base, #MSM_VIC_BASE | ||
.endm | ||
|
||
.macro arch_ret_to_user, tmp1, tmp2 | ||
.endm | ||
|
||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
@ 0xD0 has irq# or old irq# if the irq has been handled | ||
@ 0xD4 has irq# or -1 if none pending *but* if you just | ||
@ read 0xD4 you never get the first irq for some reason | ||
ldr \irqnr, [\base, #0xD0] | ||
ldr \irqnr, [\base, #0xD4] | ||
cmp \irqnr, #0xffffffff | ||
.endm |
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 @@ | ||
/* linux/include/asm-arm/arch-msm/hardware.h | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#ifndef __ASM_ARCH_MSM_HARDWARE_H | ||
|
||
#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,33 @@ | ||
/* include/asm-arm/arch-msm/io.h | ||
* | ||
* Copyright (C) 2007 Google, Inc. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#ifndef __ASM_ARM_ARCH_IO_H | ||
#define __ASM_ARM_ARCH_IO_H | ||
|
||
#define IO_SPACE_LIMIT 0xffffffff | ||
|
||
#define __arch_ioremap __msm_ioremap | ||
#define __arch_iounmap __iounmap | ||
|
||
void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype); | ||
|
||
static inline void __iomem *__io(unsigned long addr) | ||
{ | ||
return (void __iomem *)addr; | ||
} | ||
#define __io(a) __io(a) | ||
#define __mem_pci(a) (a) | ||
|
||
#endif |
Oops, something went wrong.