diff options
| author | Stephen Warren <swarren@wwwdotorg.org> | 2013-03-12 00:40:18 -0400 |
|---|---|---|
| committer | Stephen Warren <swarren@wwwdotorg.org> | 2013-03-13 00:30:45 -0400 |
| commit | f1ac922dec7ed36659344eadc65b9c06efe14d7f (patch) | |
| tree | 15147f471ab89762b3f543282d155189238b0632 | |
| parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) | |
ARM: bcm2835: convert to multi-platform
This allows BCM2835 be included in a kernel build that supports multiple
SoCs at once, which is useful for distro kernels.
This change:
* Moves bcm2835's debug-macro.S into ARM's include/debug/, and hooks it
into the relevant menu.
* Moves bcm2835's Kconfig into its own directory, as seems typical for
multi-platform conversions.
* Removes bcm2835_soc.h, and moves the content to the files where it was
used; just one usage per define.
* Deletes some headers and Makefile.boot that aren't needed now that we
support multi-platform.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
| -rw-r--r-- | arch/arm/Kconfig | 22 | ||||
| -rw-r--r-- | arch/arm/Kconfig.debug | 5 | ||||
| -rw-r--r-- | arch/arm/configs/bcm2835_defconfig | 2 | ||||
| -rw-r--r-- | arch/arm/include/debug/bcm2835.S (renamed from arch/arm/mach-bcm2835/include/mach/debug-macro.S) | 3 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/Kconfig | 15 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/Makefile.boot | 1 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/bcm2835.c | 6 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h | 29 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/include/mach/gpio.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/include/mach/timex.h | 26 | ||||
| -rw-r--r-- | arch/arm/mach-bcm2835/include/mach/uncompress.h | 44 |
11 files changed, 30 insertions, 124 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5b714695b01b..0d3daa62e8a8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -362,26 +362,6 @@ config ARCH_AT91 | |||
| 362 | This enables support for systems based on Atmel | 362 | This enables support for systems based on Atmel |
| 363 | AT91RM9200 and AT91SAM9* processors. | 363 | AT91RM9200 and AT91SAM9* processors. |
| 364 | 364 | ||
| 365 | config ARCH_BCM2835 | ||
| 366 | bool "Broadcom BCM2835 family" | ||
| 367 | select ARCH_REQUIRE_GPIOLIB | ||
| 368 | select ARM_AMBA | ||
| 369 | select ARM_ERRATA_411920 | ||
| 370 | select ARM_TIMER_SP804 | ||
| 371 | select CLKDEV_LOOKUP | ||
| 372 | select CLKSRC_OF | ||
| 373 | select COMMON_CLK | ||
| 374 | select CPU_V6 | ||
| 375 | select GENERIC_CLOCKEVENTS | ||
| 376 | select MULTI_IRQ_HANDLER | ||
| 377 | select PINCTRL | ||
| 378 | select PINCTRL_BCM2835 | ||
| 379 | select SPARSE_IRQ | ||
| 380 | select USE_OF | ||
| 381 | help | ||
| 382 | This enables support for the Broadcom BCM2835 SoC. This SoC is | ||
| 383 | use in the Raspberry Pi, and Roku 2 devices. | ||
| 384 | |||
| 385 | config ARCH_CNS3XXX | 365 | config ARCH_CNS3XXX |
| 386 | bool "Cavium Networks CNS3XXX family" | 366 | bool "Cavium Networks CNS3XXX family" |
| 387 | select ARM_GIC | 367 | select ARM_GIC |
| @@ -1037,6 +1017,8 @@ source "arch/arm/mach-at91/Kconfig" | |||
| 1037 | 1017 | ||
| 1038 | source "arch/arm/mach-bcm/Kconfig" | 1018 | source "arch/arm/mach-bcm/Kconfig" |
| 1039 | 1019 | ||
| 1020 | source "arch/arm/mach-bcm2835/Kconfig" | ||
| 1021 | |||
| 1040 | source "arch/arm/mach-clps711x/Kconfig" | 1022 | source "arch/arm/mach-clps711x/Kconfig" |
| 1041 | 1023 | ||
| 1042 | source "arch/arm/mach-cns3xxx/Kconfig" | 1024 | source "arch/arm/mach-cns3xxx/Kconfig" |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index acddddac7ee4..a877d5135d2e 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
| @@ -89,6 +89,10 @@ choice | |||
| 89 | bool "Kernel low-level debugging on 9263 and 9g45" | 89 | bool "Kernel low-level debugging on 9263 and 9g45" |
| 90 | depends on HAVE_AT91_DBGU1 | 90 | depends on HAVE_AT91_DBGU1 |
| 91 | 91 | ||
| 92 | config DEBUG_BCM2835 | ||
| 93 | bool "Kernel low-level debugging on BCM2835 PL011 UART" | ||
| 94 | depends on ARCH_BCM2835 | ||
| 95 | |||
| 92 | config DEBUG_CLPS711X_UART1 | 96 | config DEBUG_CLPS711X_UART1 |
| 93 | bool "Kernel low-level debugging messages via UART1" | 97 | bool "Kernel low-level debugging messages via UART1" |
| 94 | depends on ARCH_CLPS711X | 98 | depends on ARCH_CLPS711X |
| @@ -579,6 +583,7 @@ endchoice | |||
| 579 | 583 | ||
| 580 | config DEBUG_LL_INCLUDE | 584 | config DEBUG_LL_INCLUDE |
| 581 | string | 585 | string |
| 586 | default "debug/bcm2835.S" if DEBUG_BCM2835 | ||
| 582 | default "debug/icedcc.S" if DEBUG_ICEDCC | 587 | default "debug/icedcc.S" if DEBUG_ICEDCC |
| 583 | default "debug/imx.S" if DEBUG_IMX1_UART || \ | 588 | default "debug/imx.S" if DEBUG_IMX1_UART || \ |
| 584 | DEBUG_IMX25_UART || \ | 589 | DEBUG_IMX25_UART || \ |
diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig index af472e4ed451..3a1c939735e0 100644 --- a/arch/arm/configs/bcm2835_defconfig +++ b/arch/arm/configs/bcm2835_defconfig | |||
| @@ -29,6 +29,8 @@ CONFIG_EMBEDDED=y | |||
| 29 | CONFIG_PROFILING=y | 29 | CONFIG_PROFILING=y |
| 30 | CONFIG_OPROFILE=y | 30 | CONFIG_OPROFILE=y |
| 31 | CONFIG_JUMP_LABEL=y | 31 | CONFIG_JUMP_LABEL=y |
| 32 | CONFIG_ARCH_MULTI_V6=y | ||
| 33 | # CONFIG_ARCH_MULTI_V7 is not set | ||
| 32 | CONFIG_ARCH_BCM2835=y | 34 | CONFIG_ARCH_BCM2835=y |
| 33 | CONFIG_PREEMPT_VOLUNTARY=y | 35 | CONFIG_PREEMPT_VOLUNTARY=y |
| 34 | CONFIG_AEABI=y | 36 | CONFIG_AEABI=y |
diff --git a/arch/arm/mach-bcm2835/include/mach/debug-macro.S b/arch/arm/include/debug/bcm2835.S index 8a161e44ae28..aed9199bd847 100644 --- a/arch/arm/mach-bcm2835/include/mach/debug-macro.S +++ b/arch/arm/include/debug/bcm2835.S | |||
| @@ -11,7 +11,8 @@ | |||
| 11 | * | 11 | * |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <mach/bcm2835_soc.h> | 14 | #define BCM2835_DEBUG_PHYS 0x20201000 |
| 15 | #define BCM2835_DEBUG_VIRT 0xf0201000 | ||
| 15 | 16 | ||
| 16 | .macro addruart, rp, rv, tmp | 17 | .macro addruart, rp, rv, tmp |
| 17 | ldr \rp, =BCM2835_DEBUG_PHYS | 18 | ldr \rp, =BCM2835_DEBUG_PHYS |
diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig new file mode 100644 index 000000000000..560045cafc34 --- /dev/null +++ b/arch/arm/mach-bcm2835/Kconfig | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | config ARCH_BCM2835 | ||
| 2 | bool "Broadcom BCM2835 family" if ARCH_MULTI_V6 | ||
| 3 | select ARCH_REQUIRE_GPIOLIB | ||
| 4 | select ARM_AMBA | ||
| 5 | select ARM_ERRATA_411920 | ||
| 6 | select ARM_TIMER_SP804 | ||
| 7 | select CLKDEV_LOOKUP | ||
| 8 | select CLKSRC_OF | ||
| 9 | select CPU_V6 | ||
| 10 | select GENERIC_CLOCKEVENTS | ||
| 11 | select PINCTRL | ||
| 12 | select PINCTRL_BCM2835 | ||
| 13 | help | ||
| 14 | This enables support for the Broadcom BCM2835 SoC. This SoC is | ||
| 15 | use in the Raspberry Pi, and Roku 2 devices. | ||
diff --git a/arch/arm/mach-bcm2835/Makefile.boot b/arch/arm/mach-bcm2835/Makefile.boot deleted file mode 100644 index b3271754e9fd..000000000000 --- a/arch/arm/mach-bcm2835/Makefile.boot +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | zreladdr-y := 0x00008000 | ||
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index 6f5785985dd1..740fa9ebe249 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c | |||
| @@ -23,8 +23,6 @@ | |||
| 23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/map.h> | 24 | #include <asm/mach/map.h> |
| 25 | 25 | ||
| 26 | #include <mach/bcm2835_soc.h> | ||
| 27 | |||
| 28 | #define PM_RSTC 0x1c | 26 | #define PM_RSTC 0x1c |
| 29 | #define PM_RSTS 0x20 | 27 | #define PM_RSTS 0x20 |
| 30 | #define PM_WDOG 0x24 | 28 | #define PM_WDOG 0x24 |
| @@ -34,6 +32,10 @@ | |||
| 34 | #define PM_RSTC_WRCFG_FULL_RESET 0x00000020 | 32 | #define PM_RSTC_WRCFG_FULL_RESET 0x00000020 |
| 35 | #define PM_RSTS_HADWRH_SET 0x00000040 | 33 | #define PM_RSTS_HADWRH_SET 0x00000040 |
| 36 | 34 | ||
| 35 | #define BCM2835_PERIPH_PHYS 0x20000000 | ||
| 36 | #define BCM2835_PERIPH_VIRT 0xf0000000 | ||
| 37 | #define BCM2835_PERIPH_SIZE SZ_16M | ||
| 38 | |||
| 37 | static void __iomem *wdt_regs; | 39 | static void __iomem *wdt_regs; |
| 38 | 40 | ||
| 39 | /* | 41 | /* |
diff --git a/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h b/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h deleted file mode 100644 index d4dfcf7a9cda..000000000000 --- a/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 Stephen Warren | ||
| 3 | * | ||
| 4 | * Derived from code: | ||
| 5 | * Copyright (C) 2010 Broadcom | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __MACH_BCM2835_BCM2835_SOC_H__ | ||
| 19 | #define __MACH_BCM2835_BCM2835_SOC_H__ | ||
| 20 | |||
| 21 | #include <asm/sizes.h> | ||
| 22 | |||
| 23 | #define BCM2835_PERIPH_PHYS 0x20000000 | ||
| 24 | #define BCM2835_PERIPH_VIRT 0xf0000000 | ||
| 25 | #define BCM2835_PERIPH_SIZE SZ_16M | ||
| 26 | #define BCM2835_DEBUG_PHYS 0x20201000 | ||
| 27 | #define BCM2835_DEBUG_VIRT 0xf0201000 | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/arch/arm/mach-bcm2835/include/mach/gpio.h b/arch/arm/mach-bcm2835/include/mach/gpio.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/arm/mach-bcm2835/include/mach/gpio.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | /* empty */ | ||
diff --git a/arch/arm/mach-bcm2835/include/mach/timex.h b/arch/arm/mach-bcm2835/include/mach/timex.h deleted file mode 100644 index 6d021e136ae3..000000000000 --- a/arch/arm/mach-bcm2835/include/mach/timex.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * BCM2835 system clock frequency | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Broadcom | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __ASM_ARCH_TIMEX_H | ||
| 22 | #define __ASM_ARCH_TIMEX_H | ||
| 23 | |||
| 24 | #define CLOCK_TICK_RATE (1000000) | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/arch/arm/mach-bcm2835/include/mach/uncompress.h b/arch/arm/mach-bcm2835/include/mach/uncompress.h deleted file mode 100644 index bf86dca3bf71..000000000000 --- a/arch/arm/mach-bcm2835/include/mach/uncompress.h +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Broadcom | ||
| 3 | * Copyright (C) 2003 ARM Limited | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <linux/io.h> | ||
| 17 | #include <linux/amba/serial.h> | ||
| 18 | #include <mach/bcm2835_soc.h> | ||
| 19 | |||
| 20 | #define UART0_BASE BCM2835_DEBUG_PHYS | ||
| 21 | |||
| 22 | #define BCM2835_UART_DR IOMEM(UART0_BASE + UART01x_DR) | ||
| 23 | #define BCM2835_UART_FR IOMEM(UART0_BASE + UART01x_FR) | ||
| 24 | #define BCM2835_UART_CR IOMEM(UART0_BASE + UART011_CR) | ||
| 25 | |||
| 26 | static inline void putc(int c) | ||
| 27 | { | ||
| 28 | while (__raw_readl(BCM2835_UART_FR) & UART01x_FR_TXFF) | ||
| 29 | barrier(); | ||
| 30 | |||
| 31 | __raw_writel(c, BCM2835_UART_DR); | ||
| 32 | } | ||
| 33 | |||
| 34 | static inline void flush(void) | ||
| 35 | { | ||
| 36 | int fr; | ||
| 37 | |||
| 38 | do { | ||
| 39 | fr = __raw_readl(BCM2835_UART_FR); | ||
| 40 | barrier(); | ||
| 41 | } while ((fr & (UART011_FR_TXFE | UART01x_FR_BUSY)) != UART011_FR_TXFE); | ||
| 42 | } | ||
| 43 | |||
| 44 | #define arch_decomp_setup() | ||
