Path: blob/master/arch/arm/mach-msm/board-msm7x27.c
10817 views
/*1* Copyright (C) 2007 Google, Inc.2* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.3* Author: Brian Swetland <[email protected]>4*5* This software is licensed under the terms of the GNU General Public6* License version 2, as published by the Free Software Foundation, and7* may be copied, distributed, and modified under those terms.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14*/1516#include <linux/kernel.h>17#include <linux/init.h>18#include <linux/platform_device.h>19#include <linux/input.h>20#include <linux/io.h>21#include <linux/delay.h>22#include <linux/power_supply.h>2324#include <mach/hardware.h>25#include <asm/mach-types.h>26#include <asm/mach/arch.h>27#include <asm/mach/map.h>28#include <asm/mach/flash.h>29#include <asm/setup.h>30#ifdef CONFIG_CACHE_L2X031#include <asm/hardware/cache-l2x0.h>32#endif3334#include <mach/vreg.h>35#include <mach/mpp.h>36#include <mach/gpio.h>37#include <mach/board.h>38#include <mach/msm_iomap.h>3940#include <linux/mtd/nand.h>41#include <linux/mtd/partitions.h>4243#include "devices.h"44#include "socinfo.h"45#include "clock.h"4647static struct resource smc91x_resources[] = {48[0] = {49.start = 0x9C004300,50.end = 0x9C0043ff,51.flags = IORESOURCE_MEM,52},53[1] = {54.start = MSM_GPIO_TO_INT(132),55.end = MSM_GPIO_TO_INT(132),56.flags = IORESOURCE_IRQ,57},58};5960static struct platform_device smc91x_device = {61.name = "smc91x",62.id = 0,63.num_resources = ARRAY_SIZE(smc91x_resources),64.resource = smc91x_resources,65};6667static struct platform_device *devices[] __initdata = {68&msm_device_uart3,69&msm_device_smd,70&msm_device_dmov,71&msm_device_nand,72&smc91x_device,73};7475extern struct sys_timer msm_timer;7677static void __init msm7x2x_init_irq(void)78{79msm_init_irq();80}8182static void __init msm7x2x_init(void)83{84if (socinfo_init() < 0)85BUG();8687if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) {88smc91x_resources[0].start = 0x98000300;89smc91x_resources[0].end = 0x980003ff;90smc91x_resources[1].start = MSM_GPIO_TO_INT(85);91smc91x_resources[1].end = MSM_GPIO_TO_INT(85);92if (gpio_tlmm_config(GPIO_CFG(85, 0,93GPIO_INPUT,94GPIO_PULL_DOWN,95GPIO_2MA),96GPIO_ENABLE)) {97printk(KERN_ERR98"%s: Err: Config GPIO-85 INT\n",99__func__);100}101}102103platform_add_devices(devices, ARRAY_SIZE(devices));104}105106static void __init msm7x2x_map_io(void)107{108msm_map_common_io();109/* Technically dependent on the SoC but using machine_is110* macros since socinfo is not available this early and there111* are plans to restructure the code which will eliminate the112* need for socinfo.113*/114if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa())115msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27);116117if (machine_is_msm7x25_surf() || machine_is_msm7x25_ffa())118msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25);119120#ifdef CONFIG_CACHE_L2X0121if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) {122/* 7x27 has 256KB L2 cache:12364Kb/Way and 4-Way Associativity;124R/W latency: 3 cycles;125evmon/parity/share disabled. */126l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);127}128#endif129}130131MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")132.boot_params = PLAT_PHYS_OFFSET + 0x100,133.map_io = msm7x2x_map_io,134.init_irq = msm7x2x_init_irq,135.init_machine = msm7x2x_init,136.timer = &msm_timer,137MACHINE_END138139MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")140.boot_params = PLAT_PHYS_OFFSET + 0x100,141.map_io = msm7x2x_map_io,142.init_irq = msm7x2x_init_irq,143.init_machine = msm7x2x_init,144.timer = &msm_timer,145MACHINE_END146147MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")148.boot_params = PLAT_PHYS_OFFSET + 0x100,149.map_io = msm7x2x_map_io,150.init_irq = msm7x2x_init_irq,151.init_machine = msm7x2x_init,152.timer = &msm_timer,153MACHINE_END154155MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")156.boot_params = PLAT_PHYS_OFFSET + 0x100,157.map_io = msm7x2x_map_io,158.init_irq = msm7x2x_init_irq,159.init_machine = msm7x2x_init,160.timer = &msm_timer,161MACHINE_END162163164