Commit 3b325a49 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'armsoc/for-3.15/soc-3' of git://github.com/broadcom/mach-bcm into next/soc

Merge "ARM: mach-bcm: soc updates for 3.15 - part 2" from Matt Porter:

- Add bcm21664 support
- Use Kona Debug UART only on ARCH_BCM_MOBILE

* tag 'armsoc/for-3.15/soc-3' of git://github.com/broadcom/mach-bcm

:
  ARM: restrict BCM_KONA_UART to ARCH_BCM_MOBILE
  ARM: bcm21664: Add board support.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 8efa50c5 7aa2077b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ choice

	config DEBUG_BCM_KONA_UART
		bool "Kernel low-level debugging messages via BCM KONA UART"
		depends on ARCH_BCM
		depends on ARCH_BCM_MOBILE
		select DEBUG_UART_8250
		help
		  Say Y here if you want kernel low-level debugging support
+4 −2
Original line number Diff line number Diff line
#
# Copyright (C) 2012-2013 Broadcom Corporation
# Copyright (C) 2012-2014 Broadcom Corporation
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -10,7 +10,9 @@
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

obj-$(CONFIG_ARCH_BCM_MOBILE)	:= board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
obj-$(CONFIG_ARCH_BCM_MOBILE)	:= board_bcm281xx.o board_bcm21664.o \
				bcm_kona_smc.o bcm_kona_smc_asm.o kona.o

plus_sec := $(call as-instr,.arch_extension sec,+sec)
AFLAGS_bcm_kona_smc_asm.o	:=-Wa,-march=armv7-a$(plus_sec)
obj-$(CONFIG_ARCH_BCM_5301X)	+= bcm_5301x.o
+78 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 Broadcom Corporation
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation version 2.
 *
 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
 * kind, whether express or implied; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/clocksource.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>

#include <asm/mach/arch.h>

#include "bcm_kona_smc.h"
#include "kona.h"

#define RSTMGR_DT_STRING		"brcm,bcm21664-resetmgr"

#define RSTMGR_REG_WR_ACCESS_OFFSET	0
#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET	4

#define RSTMGR_WR_PASSWORD		0xa5a5
#define RSTMGR_WR_PASSWORD_SHIFT	8
#define RSTMGR_WR_ACCESS_ENABLE		1

static void bcm21664_restart(enum reboot_mode mode, const char *cmd)
{
	void __iomem *base;
	struct device_node *resetmgr;

	resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING);
	if (!resetmgr) {
		pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n");
		return;
	}
	base = of_iomap(resetmgr, 0);
	if (!base) {
		pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n");
		return;
	}

	/*
	 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset
	 * register. To write to that register we must first write the password
	 * and the enable bit in the write access enable register.
	 */
	writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) |
		RSTMGR_WR_ACCESS_ENABLE,
		base + RSTMGR_REG_WR_ACCESS_OFFSET);
	writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET);

	/* Wait for reset */
	while (1);
}

static void __init bcm21664_init(void)
{
	of_platform_populate(NULL, of_default_bus_match_table, NULL,
		&platform_bus);
	kona_l2_cache_init();
}

static const char * const bcm21664_dt_compat[] = {
	"brcm,bcm21664",
	NULL,
};

DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor")
	.init_machine = bcm21664_init,
	.restart = bcm21664_restart,
	.dt_compat = bcm21664_dt_compat,
MACHINE_END