Skip to content
Permalink
Browse files

Merge pull request #1678 from notro/bcm270x-cleanup-1

bcm270x: Platform file cleanup
  • Loading branch information...
popcornmix committed Oct 11, 2016
2 parents dc2d56d + 8b1d6e3 commit de0f4d62fb7adcf5367f24259299a589de12acd9
@@ -147,12 +147,12 @@ choice

config DEBUG_BCM2835
bool "Kernel low-level debugging on BCM2835 PL011 UART"
depends on ARCH_BCM2835 && ARCH_MULTI_V6
depends on (ARCH_BCM2835 && ARCH_MULTI_V6) || ARCH_BCM2708
select DEBUG_UART_PL01X

config DEBUG_BCM2836
bool "Kernel low-level debugging on BCM2836 PL011 UART"
depends on ARCH_BCM2835 && ARCH_MULTI_V7
depends on (ARCH_BCM2835 && ARCH_MULTI_V7) || ARCH_BCM2709
select DEBUG_UART_PL01X

config DEBUG_BCM_5301X
@@ -1312,14 +1312,6 @@ choice
options; the platform specific options are deprecated
and will be soon removed.

config DEBUG_BCM2708_UART0
bool "Broadcom BCM270X UART0 (PL011)"
depends on ARCH_BCM2708 || ARCH_BCM2709
help
Say Y here if you want the debug print routines to direct
their output to UART 0. The port must have been initialised
by the boot-loader before use.

endchoice

config DEBUG_AT91_UART
@@ -1703,7 +1695,8 @@ config DEBUG_UART_8250_FLOW_CONTROL

config DEBUG_UNCOMPRESS
bool
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \
ARCH_BCM2708 || ARCH_BCM2709
default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
(!DEBUG_TEGRA_UART || !ZBOOT_ROM)
help
@@ -1720,7 +1713,8 @@ config DEBUG_UNCOMPRESS
config UNCOMPRESS_INCLUDE
string
default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \
PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \
ARCH_BCM2708 || ARCH_BCM2709
default "mach/uncompress.h"

config EARLY_PRINTK
@@ -21,29 +21,6 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

/* Use this hack until a proper solution is agreed upon */
static void __init bcm2835_init_uart1(void)
{
struct device_node *np;

np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart");
if (of_device_is_available(np)) {
np = of_find_compatible_node(NULL, NULL,
"bcrm,bcm2835-aux-enable");
if (np) {
void __iomem *base = of_iomap(np, 0);

if (!base) {
pr_err("bcm2835: Failed enabling Mini UART\n");
return;
}

writel(1, base);
pr_info("bcm2835: Mini UART enabled\n");
}
}
}

static void __init bcm2835_init(void)
{
struct device_node *np = of_find_node_by_path("/system");
@@ -56,8 +33,6 @@ static void __init bcm2835_init(void)
system_rev = val;
if (!of_property_read_u64(np, "linux,serial", &val64))
system_serial_low = val64;

bcm2835_init_uart1();
}

static const char * const bcm2835_compat[] = {
@@ -19,125 +19,23 @@
*/

#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <asm/system_info.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include <mach/system.h>

#include <linux/broadcom/vc_cma.h>

/* Effectively we have an IOMMU (ARM<->VideoCore map) that is set up to
* give us IO access only to 64Mbytes of physical memory (26 bits). We could
* represent this window by setting our dmamasks to 26 bits but, in fact
* we're not going to use addresses outside this range (they're not in real
* memory) so we don't bother.
*
* In the future we might include code to use this IOMMU to remap other
* physical addresses onto VideoCore memory then the use of 32-bits would be
* more legitimate.
*/
#include <asm/mach/arch.h>
#include <asm/system_info.h>

/* command line parameters */
static unsigned boardrev, serial;

static struct map_desc bcm2708_io_desc[] __initdata = {
{
.virtual = IO_ADDRESS(ARMCTRL_BASE),
.pfn = __phys_to_pfn(ARMCTRL_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(UART0_BASE),
.pfn = __phys_to_pfn(UART0_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(UART1_BASE),
.pfn = __phys_to_pfn(UART1_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(DMA_BASE),
.pfn = __phys_to_pfn(DMA_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(MCORE_BASE),
.pfn = __phys_to_pfn(MCORE_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(ST_BASE),
.pfn = __phys_to_pfn(ST_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(USB_BASE),
.pfn = __phys_to_pfn(USB_BASE),
.length = SZ_128K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(PM_BASE),
.pfn = __phys_to_pfn(PM_BASE),
.length = SZ_4K,
.type = MT_DEVICE},
{
.virtual = IO_ADDRESS(GPIO_BASE),
.pfn = __phys_to_pfn(GPIO_BASE),
.length = SZ_4K,
.type = MT_DEVICE}
};

void __init bcm2708_map_io(void)
static void __init bcm2708_init(void)
{
iotable_init(bcm2708_io_desc, ARRAY_SIZE(bcm2708_io_desc));
}

static void __init bcm2708_init_uart1(void)
{
struct device_node *np;

np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart");
if (of_device_is_available(np)) {
pr_info("bcm2708: Mini UART enabled\n");
writel(1, __io_address(UART1_BASE + 0x4));
}
}

void __init bcm2708_init(void)
{
int ret;

vc_cma_early_init();

ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
NULL);
if (ret) {
pr_err("of_platform_populate failed: %d\n", ret);
BUG();
}

bcm2708_init_uart1();

system_rev = boardrev;
system_serial_low = serial;
}

void __init bcm2708_init_early(void)
{
/*
* Some devices allocate their coherent buffers from atomic
* context. Increase size of atomic coherent pool to make sure such
* the allocations won't fail.
*/
init_dma_coherent_pool_size(SZ_4M);
}

static void __init board_reserve(void)
{
vc_cma_reserve();
@@ -148,11 +46,9 @@ static const char * const bcm2708_compat[] = {
NULL
};

MACHINE_START(BCM2708, "BCM2708")
DT_MACHINE_START(BCM2708, "BCM2708")
/* Maintainer: Broadcom Europe Ltd. */
.map_io = bcm2708_map_io,
.init_machine = bcm2708_init,
.init_early = bcm2708_init_early,
.reserve = board_reserve,
.dt_compat = bcm2708_compat,
MACHINE_END

This file was deleted.

This file was deleted.

0 comments on commit de0f4d6

Please sign in to comment.
You can’t perform that action at this time.