Path: blob/master/arch/arm/mach-msm/board-sapphire.c
10817 views
/* linux/arch/arm/mach-msm/board-sapphire.c1* Copyright (C) 2007-2009 HTC Corporation.2* Author: Thomas Tsai <[email protected]>3*4* This software is licensed under the terms of the GNU General Public5* License version 2, as published by the Free Software Foundation, and6* may be copied, distributed, and modified under those terms.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*/1314#include <linux/kernel.h>15#include <linux/init.h>16#include <linux/platform_device.h>17#include <linux/input.h>18#include <linux/interrupt.h>19#include <linux/irq.h>20#include <linux/sysdev.h>2122#include <linux/delay.h>2324#include <asm/gpio.h>25#include <mach/hardware.h>26#include <asm/mach-types.h>27#include <asm/mach/arch.h>28#include <asm/mach/map.h>29#include <asm/mach/flash.h>30#include <asm/system.h>31#include <mach/system.h>32#include <mach/vreg.h>33#include <mach/board.h>3435#include <asm/io.h>36#include <asm/delay.h>37#include <asm/setup.h>3839#include <linux/mtd/nand.h>40#include <linux/mtd/partitions.h>4142#include "gpio_chip.h"43#include "board-sapphire.h"44#include "proc_comm.h"45#include "devices.h"4647void msm_init_irq(void);48void msm_init_gpio(void);4950static struct platform_device *devices[] __initdata = {51&msm_device_smd,52&msm_device_dmov,53&msm_device_nand,54&msm_device_uart1,55&msm_device_uart3,56};5758extern struct sys_timer msm_timer;5960static void __init sapphire_init_irq(void)61{62msm_init_irq();63}6465static void __init sapphire_init(void)66{67platform_add_devices(devices, ARRAY_SIZE(devices));68}6970static struct map_desc sapphire_io_desc[] __initdata = {71{72.virtual = SAPPHIRE_CPLD_BASE,73.pfn = __phys_to_pfn(SAPPHIRE_CPLD_START),74.length = SAPPHIRE_CPLD_SIZE,75.type = MT_DEVICE_NONSHARED76}77};7879static void __init sapphire_fixup(struct machine_desc *desc, struct tag *tags,80char **cmdline, struct meminfo *mi)81{82int smi_sz = parse_tag_smi((const struct tag *)tags);8384mi->nr_banks = 1;85mi->bank[0].start = PHYS_OFFSET;86mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);87if (smi_sz == 32) {88mi->bank[0].size = (84*1024*1024);89} else if (smi_sz == 64) {90mi->bank[0].size = (101*1024*1024);91} else {92/* Give a default value when not get smi size */93smi_sz = 64;94mi->bank[0].size = (101*1024*1024);95}96}9798static void __init sapphire_map_io(void)99{100msm_map_common_io();101iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));102msm_clock_init();103}104105MACHINE_START(SAPPHIRE, "sapphire")106/* Maintainer: Brian Swetland <[email protected]> */107.boot_params = PLAT_PHYS_OFFSET + 0x100,108.fixup = sapphire_fixup,109.map_io = sapphire_map_io,110.init_irq = sapphire_init_irq,111.init_machine = sapphire_init,112.timer = &msm_timer,113MACHINE_END114115116