Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2010 Broadcom |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/of_platform.h> |
| 17 | |
| 18 | #include <asm/mach/arch.h> |
| 19 | #include <asm/mach/map.h> |
| 20 | #include <asm/mach/time.h> |
| 21 | #include <asm/exception.h> |
| 22 | |
| 23 | #include <mach/bcm2835_soc.h> |
| 24 | |
| 25 | static struct map_desc io_map __initdata = { |
| 26 | .virtual = BCM2835_PERIPH_VIRT, |
| 27 | .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS), |
| 28 | .length = BCM2835_PERIPH_SIZE, |
| 29 | .type = MT_DEVICE |
| 30 | }; |
| 31 | |
| 32 | void __init bcm2835_map_io(void) |
| 33 | { |
| 34 | iotable_init(&io_map, 1); |
| 35 | } |
| 36 | |
| 37 | void __init bcm2835_init_irq(void) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | asmlinkage void __exception_irq_entry bcm2835_handle_irq(struct pt_regs *regs) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | void __init bcm2835_init(void) |
| 46 | { |
| 47 | int ret; |
| 48 | |
| 49 | ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, |
| 50 | NULL); |
| 51 | if (ret) { |
| 52 | pr_err("of_platform_populate failed: %d\n", ret); |
| 53 | BUG(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | static void __init bcm2835_timer_init(void) |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | struct sys_timer bcm2835_timer = { |
| 62 | .init = bcm2835_timer_init |
| 63 | }; |
| 64 | |
| 65 | static const char * const bcm2835_compat[] = { |
| 66 | "brcm,bcm2835", |
| 67 | NULL |
| 68 | }; |
| 69 | |
| 70 | DT_MACHINE_START(BCM2835, "BCM2835") |
| 71 | .map_io = bcm2835_map_io, |
| 72 | .init_irq = bcm2835_init_irq, |
| 73 | .handle_irq = bcm2835_handle_irq, |
| 74 | .init_machine = bcm2835_init, |
| 75 | .timer = &bcm2835_timer, |
| 76 | .dt_compat = bcm2835_compat |
| 77 | MACHINE_END |