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> |
Axel Lin | 5702941 | 2013-07-05 00:31:36 +0800 | [diff] [blame] | 16 | #include <linux/irqchip.h> |
Stephen Warren | d0f1c7f | 2012-09-15 22:18:10 -0600 | [diff] [blame] | 17 | #include <linux/of_address.h> |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 18 | #include <linux/of_platform.h> |
Simon Arlott | 75fabc3 | 2012-09-10 23:26:15 -0600 | [diff] [blame] | 19 | #include <linux/clk/bcm2835.h> |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 20 | |
| 21 | #include <asm/mach/arch.h> |
| 22 | #include <asm/mach/map.h> |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 23 | |
Domenico Andreoli | dd3c754 | 2012-10-20 03:35:27 +0200 | [diff] [blame] | 24 | static void __init bcm2835_init(void) |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 25 | { |
| 26 | int ret; |
| 27 | |
Simon Arlott | 75fabc3 | 2012-09-10 23:26:15 -0600 | [diff] [blame] | 28 | bcm2835_init_clocks(); |
| 29 | |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 30 | ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, |
| 31 | NULL); |
| 32 | if (ret) { |
| 33 | pr_err("of_platform_populate failed: %d\n", ret); |
| 34 | BUG(); |
| 35 | } |
| 36 | } |
| 37 | |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 38 | static const char * const bcm2835_compat[] = { |
Eric Anholt | c1be3c1 | 2015-12-16 15:55:14 -0800 | [diff] [blame] | 39 | #ifdef CONFIG_ARCH_MULTI_V6 |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 40 | "brcm,bcm2835", |
Eric Anholt | c1be3c1 | 2015-12-16 15:55:14 -0800 | [diff] [blame] | 41 | #endif |
| 42 | #ifdef CONFIG_ARCH_MULTI_V7 |
| 43 | "brcm,bcm2836", |
| 44 | #endif |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 45 | NULL |
| 46 | }; |
| 47 | |
| 48 | DT_MACHINE_START(BCM2835, "BCM2835") |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 49 | .init_machine = bcm2835_init, |
Simon Arlott | ec9653b | 2012-05-26 01:04:43 -0600 | [diff] [blame] | 50 | .dt_compat = bcm2835_compat |
| 51 | MACHINE_END |