All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darwin Rambo <drambo@broadcom.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/6] arch: kona: Initial commit of kona-common architecture code
Date: Thu, 6 Feb 2014 19:23:03 -0800	[thread overview]
Message-ID: <1391743388-5539-2-git-send-email-drambo@broadcom.com> (raw)
In-Reply-To: <1391743388-5539-1-git-send-email-drambo@broadcom.com>

The Kona architecture is present on a number of Broadcom mobile SoCs
including the bcm281xx family of chips.

Signed-off-by: Darwin Rambo <drambo@broadcom.com>
Reviewed-by: Steve Rae <srae@broadcom.com>
Reviewed-by: Tim Kryger <tkryger@linaro.org>
---
 arch/arm/cpu/armv7/Makefile                    |    1 +
 arch/arm/cpu/armv7/kona-common/Makefile        |    9 ++++++++
 arch/arm/cpu/armv7/kona-common/clk-stubs.c     |   21 +++++++++++++++++
 arch/arm/cpu/armv7/kona-common/hwinit-common.c |   16 +++++++++++++
 arch/arm/cpu/armv7/kona-common/s_init.c        |   12 ++++++++++
 arch/arm/include/asm/kona-common/clk.h         |   29 ++++++++++++++++++++++++
 arch/arm/include/asm/kona-common/kona_sdhci.h  |   12 ++++++++++
 7 files changed, 100 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/kona-common/Makefile
 create mode 100644 arch/arm/cpu/armv7/kona-common/clk-stubs.c
 create mode 100644 arch/arm/cpu/armv7/kona-common/hwinit-common.c
 create mode 100644 arch/arm/cpu/armv7/kona-common/s_init.c
 create mode 100644 arch/arm/include/asm/kona-common/clk.h
 create mode 100644 arch/arm/include/asm/kona-common/kona_sdhci.h

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 0467d00..119ebb3 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -23,6 +23,7 @@ obj-y	+= nonsec_virt.o
 obj-y	+= virt-v7.o
 endif
 
+obj-$(CONFIG_KONA) += kona-common/
 obj-$(CONFIG_OMAP_COMMON) += omap-common/
 obj-$(CONFIG_TEGRA) += tegra-common/
 
diff --git a/arch/arm/cpu/armv7/kona-common/Makefile b/arch/arm/cpu/armv7/kona-common/Makefile
new file mode 100644
index 0000000..8af6f2c
--- /dev/null
+++ b/arch/arm/cpu/armv7/kona-common/Makefile
@@ -0,0 +1,9 @@
+#
+# Copyright 2013 Broadcom Corporation.	All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= s_init.o
+obj-y	+= hwinit-common.o
+obj-y	+= clk-stubs.o
diff --git a/arch/arm/cpu/armv7/kona-common/clk-stubs.c b/arch/arm/cpu/armv7/kona-common/clk-stubs.c
new file mode 100644
index 0000000..824d597
--- /dev/null
+++ b/arch/arm/cpu/armv7/kona-common/clk-stubs.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2013 Broadcom Corporation.  All rights reserved.
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#include <common.h>
+
+/*
+ * These weak functions are available to kona architectures that don't
+ * require clock enables from the driver code.
+ */
+int __weak clk_sdio_enable(void *base, u32 rate, u32 *actual_ratep)
+{
+	return 0;
+}
+
+int __weak clk_bsc_enable(void *base, u32 rate, u32 *actual_ratep)
+{
+	return 0;
+}
diff --git a/arch/arm/cpu/armv7/kona-common/hwinit-common.c b/arch/arm/cpu/armv7/kona-common/hwinit-common.c
new file mode 100644
index 0000000..eb046a5
--- /dev/null
+++ b/arch/arm/cpu/armv7/kona-common/hwinit-common.c
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2013 Broadcom Corporation.  All rights reserved.
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/sizes.h>
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+	/* Enable D-cache. I-cache is already enabled in start.S */
+	dcache_enable();
+}
+#endif
diff --git a/arch/arm/cpu/armv7/kona-common/s_init.c b/arch/arm/cpu/armv7/kona-common/s_init.c
new file mode 100644
index 0000000..000442c
--- /dev/null
+++ b/arch/arm/cpu/armv7/kona-common/s_init.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2014 Broadcom Corporation.  All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/*
+ * Early system init. Currently empty.
+ */
+void s_init(void)
+{
+}
diff --git a/arch/arm/include/asm/kona-common/clk.h b/arch/arm/include/asm/kona-common/clk.h
new file mode 100644
index 0000000..52031d3
--- /dev/null
+++ b/arch/arm/include/asm/kona-common/clk.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2013 Broadcom Corporation.  All rights reserved.
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+/* This API file is loosely based on u-boot/drivers/video/ipu.h and linux */
+
+#ifndef __KONA_COMMON_CLK_H
+#define __KONA_COMMON_CLK_H
+
+#include <linux/types.h>
+
+struct clk;
+
+/* Only implement required functions for your specific architecture */
+int clk_init(void);
+struct clk *clk_get(const char *id);
+int clk_enable(struct clk *clk);
+void clk_disable(struct clk *clk);
+unsigned long clk_get_rate(struct clk *clk);
+long clk_round_rate(struct clk *clk, unsigned long rate);
+int clk_set_rate(struct clk *clk, unsigned long rate);
+int clk_set_parent(struct clk *clk, struct clk *parent);
+struct clk *clk_get_parent(struct clk *clk);
+int clk_sdio_enable(void *base, u32 rate, u32 *actual_ratep);
+int clk_bsc_enable(void *base);
+
+#endif
diff --git a/arch/arm/include/asm/kona-common/kona_sdhci.h b/arch/arm/include/asm/kona-common/kona_sdhci.h
new file mode 100644
index 0000000..03f04dd
--- /dev/null
+++ b/arch/arm/include/asm/kona-common/kona_sdhci.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2013 Broadcom Corporation.  All rights reserved.
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#ifndef __KONA_SDHCI_H
+#define __KONA_SDHCI_H
+
+int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks);
+
+#endif
-- 
1.7.9.5

  reply	other threads:[~2014-02-07  3:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07  3:23 [U-Boot] [PATCH v3 0/6] Introducing the Broadcom bcm281xx Architecture Darwin Rambo
2014-02-07  3:23 ` Darwin Rambo [this message]
2014-02-10  8:44   ` [U-Boot] [PATCH v3 1/6] arch: kona: Initial commit of kona-common architecture code Albert ARIBAUD
2014-02-10 20:29     ` Tom Rini
2014-02-07  3:23 ` [U-Boot] [PATCH v3 2/6] arch: bcm281xx: Initial commit of bcm281xx " Darwin Rambo
2014-02-07  3:23 ` [U-Boot] [PATCH v3 3/6] gpio: kona: Add Kona gpio driver Darwin Rambo
2014-02-07  3:23 ` [U-Boot] [PATCH v3 4/6] i2c: kona: Add Kona I2C driver Darwin Rambo
2014-02-07  3:23 ` [U-Boot] [PATCH v3 5/6] mmc: kona: Add Kona mmc driver Darwin Rambo
2014-02-07  3:23 ` [U-Boot] [PATCH v3 6/6] board: bcm28155_ap: Add board files Darwin Rambo
2014-02-07  3:39 ` [U-Boot] [PATCH v3 0/6] Introducing the Broadcom bcm281xx Architecture Darwin Rambo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391743388-5539-2-git-send-email-drambo@broadcom.com \
    --to=drambo@broadcom.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.