Skip to contentSkip to conversation

Introducing the Broadcom bcm281xx Architecture

PATCH New Darwin Rambo 4 participants 23 messages Jan 27, 2014 – Jan 31, 2014

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover Introducing the Broadcom bcm281xx Architecture

This patchset introduces the Broadcom bcm281xx family of mobile SoC chips. Broadcom kona hardware blocks are often found in Broadcom mobile SoC chips including the bcm281xx family, so support for some of these kona blocks is also provided here. These patches work on u-boot master as well as the u-boot-arm custodian tree.

Darwin Rambo (6):
arch: kona: Initial commit of kona-common architecture code
arch: bcm281xx: Initial commit of bcm281xx architecture code
gpio: kona: Add Kona gpio driver
i2c: kona: Add Kona I2C driver
mmc: kona: Add Kona mmc driver
board: bcm28155_ap: Add board files

 arch/arm/cpu/armv7/Makefile                    |    1 +
 arch/arm/cpu/armv7/bcm281xx/Makefile           |   11 +
 arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c     |  525 +++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-bsc.c          |   54 ++
 arch/arm/cpu/armv7/bcm281xx/clk-core.c         |  536 +++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-core.h         |  510 +++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-sdio.c         |   75 +++
 arch/arm/cpu/armv7/bcm281xx/reset.c            |   29 +
 arch/arm/cpu/armv7/kona-common/Makefile        |   10 +
 arch/arm/cpu/armv7/kona-common/clk-stubs.c     |   22 +
 arch/arm/cpu/armv7/kona-common/hwinit-common.c |   18 +
 arch/arm/cpu/armv7/kona-common/lowlevel_init.S |   15 +
 arch/arm/cpu/armv7/kona-common/proc.c          |   20 +
 arch/arm/include/asm/arch-bcm281xx/gpio.h      |   17 +
 arch/arm/include/asm/arch-bcm281xx/sysmap.h    |   27 +
 arch/arm/include/asm/kona-common/clk.h         |   31 +
 arch/arm/include/asm/kona-common/misc.h        |   20 +
 board/broadcom/bcm28155_ap/Makefile            |    7 +
 board/broadcom/bcm28155_ap/bcm28155_ap.c       |   99 ++++
 boards.cfg                                     |    1 +
 drivers/gpio/Makefile                          |    1 +
 drivers/gpio/kona_gpio.c                       |  143 +++++
 drivers/i2c/Makefile                           |    1 +
 drivers/i2c/kona_i2c.c                         |  730 ++++++++++++++++++++++++
 drivers/mmc/Makefile                           |    1 +
 drivers/mmc/kona_sdhci.c                       |  127 +++++
 include/configs/bcm28155_ap.h                  |  148 +++++
 27 files changed, 3179 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/Makefile
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-bsc.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-core.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-core.h
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-sdio.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/reset.c
 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/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/kona-common/proc.c
 create mode 100644 arch/arm/include/asm/arch-bcm281xx/gpio.h
 create mode 100644 arch/arm/include/asm/arch-bcm281xx/sysmap.h
 create mode 100644 arch/arm/include/asm/kona-common/clk.h
 create mode 100644 arch/arm/include/asm/kona-common/misc.h
 create mode 100644 board/broadcom/bcm28155_ap/Makefile
 create mode 100644 board/broadcom/bcm28155_ap/bcm28155_ap.c
 create mode 100644 drivers/gpio/kona_gpio.c
 create mode 100644 drivers/i2c/kona_i2c.c
 create mode 100644 drivers/mmc/kona_sdhci.c
 create mode 100644 include/configs/bcm28155_ap.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/6 arch: kona: Initial commit of kona-common architecture code

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

---
 arch/arm/cpu/armv7/Makefile                    |    1 +
 arch/arm/cpu/armv7/kona-common/Makefile        |   10 ++++++++
 arch/arm/cpu/armv7/kona-common/clk-stubs.c     |   22 +++++++++++++++++
 arch/arm/cpu/armv7/kona-common/hwinit-common.c |   18 ++++++++++++++
 arch/arm/cpu/armv7/kona-common/lowlevel_init.S |   15 ++++++++++++
 arch/arm/cpu/armv7/kona-common/proc.c          |   20 +++++++++++++++
 arch/arm/include/asm/kona-common/clk.h         |   31 ++++++++++++++++++++++++
 arch/arm/include/asm/kona-common/misc.h        |   20 +++++++++++++++
 8 files changed, 137 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/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/kona-common/proc.c
 create mode 100644 arch/arm/include/asm/kona-common/clk.h
 create mode 100644 arch/arm/include/asm/kona-common/misc.h
arch/arm/cpu/armv7/Makefile +1 -0
index 0467d00..119ebb3 100644
@@ -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/
 
arch/arm/cpu/armv7/kona-common/Makefile new file +10 -0
new file mode 100644
index 0000000..9a7c167
@@ -0,0 +1,10 @@
+#
+# Copyright 2013 Broadcom Corporation.	All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= clk-stubs.o
+obj-y	+= hwinit-common.o
+obj-y	+= proc.o
+obj-y	+= lowlevel_init.o
arch/arm/cpu/armv7/kona-common/clk-stubs.c new file +22 -0
new file mode 100644
index 0000000..dd3ce34
@@ -0,0 +1,22 @@
+/*****************************************************************************
+*
+* 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;
+}
arch/arm/cpu/armv7/kona-common/hwinit-common.c new file +18 -0
new file mode 100644
index 0000000..5d6b131
@@ -0,0 +1,18 @@
+/*****************************************************************************
+*
+* 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
arch/arm/cpu/armv7/kona-common/lowlevel_init.S new file +15 -0
new file mode 100644
index 0000000..a03afcc
@@ -0,0 +1,15 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+//#include <asm-offsets.h>
+//#include <config.h>
+//#include <linux/linkage.h>
+
+.globl lowlevel_init
+lowlevel_init:
+	mov	pc, lr
arch/arm/cpu/armv7/kona-common/proc.c new file +20 -0
new file mode 100644
index 0000000..92fb39b
@@ -0,0 +1,20 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/kona-common/misc.h>
+#include <asm/armv7.h>
+
+void do_proc_wfe(int forever)
+{
+	do {
+		asm volatile ("wfe	@ wait for event\n");
+		/*printf("wake up from wfe\n"); */
+	} while (forever);
+}
arch/arm/include/asm/kona-common/clk.h new file +31 -0
new file mode 100644
index 0000000..c26c6a4
@@ -0,0 +1,31 @@
+/*****************************************************************************
+*
+* 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
arch/arm/include/asm/kona-common/misc.h new file +20 -0
new file mode 100644
index 0000000..8506bbc
@@ -0,0 +1,20 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#ifndef __KONA_COMMON_MISC_H
+#define __KONA_COMMON_MISC_H
+
+#include <mmc.h>
+
+void hw_watchdog_disable(void);
+int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks);
+int kona_i2c_init(unsigned int dev_idx, unsigned long base_addr);
+
+void proc_on_wfi(void);
+
+#endif
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/6 arch: kona: Initial commit of kona-common architecture code

Quoted 2 lines · Darwin Rambo

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

[snip]

arch/arm/cpu/armv7/kona-common/clk-stubs.c line 22

Quoted 8 lines
arch/arm/cpu/armv7/kona-common/clk-stubs.c new file +8 -0
+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;
+}

Blank lines between functions please.

Quoted 11 lines
arch/arm/cpu/armv7/kona-common/lowlevel_init.S new file +5 -0
new file mode 100644
index 0000000..a03afcc
@@ -0,0 +1,15 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+

arch/arm/cpu/armv7/kona-common/lowlevel_init.S line 15

Quoted 10 lines
arch/arm/cpu/armv7/kona-common/lowlevel_init.S new file +10 -0
+*
+*****************************************************************************/
+
+//#include <asm-offsets.h>
+//#include <config.h>
+//#include <linux/linkage.h>
+
+.globl lowlevel_init
+lowlevel_init:
+	mov	pc, lr

(a) no commented out include lines
(b) This is empty, which seems wrong. I strongly suspect you want to make use of arch/arm/cpu/armv7/lowlevel_init.S and have an s_init function, ala omap*/tegra/rmobile/etc.

Quoted 14 lines
arch/arm/cpu/armv7/kona-common/proc.c new file +8 -0
new file mode 100644
index 0000000..92fb39b
@@ -0,0 +1,20 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+

arch/arm/cpu/armv7/kona-common/proc.c line 18

Quoted 10 lines
arch/arm/cpu/armv7/kona-common/proc.c new file +10 -0
+#include <common.h>
+#include <asm/io.h>
+#include <asm/kona-common/misc.h>
+#include <asm/armv7.h>
+
+void do_proc_wfe(int forever)
+{
+	do {
+		asm volatile ("wfe	@ wait for event\n");
+		/*printf("wake up from wfe\n"); */

No commented out printf, thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140129/6a70f2ed/attachment.pgp>
#3 lore raw

PATCH 1/6 arch: kona: Initial commit of kona-common architecture code

Quoted 5 lines · Tom Rini
Quoted 2 lines · Darwin Rambo

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

[snip]

Quoted 10 lines

arch/arm/cpu/armv7/kona-common/clk-stubs.c line 22

Quoted 8 lines
arch/arm/cpu/armv7/kona-common/clk-stubs.c new file +8 -0
+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;
+}

Blank lines between functions please.

OK

Quoted 16 lines
Quoted 16 lines
arch/arm/cpu/armv7/kona-common/lowlevel_init.S new file +9 -0
new file mode 100644
index 0000000..a03afcc
@@ -0,0 +1,15 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+//#include <asm-offsets.h>
Quoted 8 lines

arch/arm/cpu/armv7/kona-common/lowlevel_init.S line 15

Quoted 6 lines
arch/arm/cpu/armv7/kona-common/lowlevel_init.S new file +6 -0
+//#include <config.h>
+//#include <linux/linkage.h>
+
+.globl lowlevel_init
+lowlevel_init:
+	mov	pc, lr

(a) no commented out include lines

OK

Quoted 3 lines

(b) This is empty, which seems wrong. I strongly suspect you want to make use of arch/arm/cpu/armv7/lowlevel_init.S and have an s_init function, ala omap*/tegra/rmobile/etc.

Will check this out. Thanks.

Quoted 19 lines
Quoted 19 lines
arch/arm/cpu/armv7/kona-common/proc.c new file +12 -0
new file mode 100644
index 0000000..92fb39b
@@ -0,0 +1,20 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/kona-common/misc.h>
+#include <asm/armv7.h>
Quoted 9 lines

arch/arm/cpu/armv7/kona-common/proc.c line 18

Quoted 6 lines
arch/arm/cpu/armv7/kona-common/proc.c new file +6 -0
+
+void do_proc_wfe(int forever)
+{
+	do {
+		asm volatile ("wfe	@ wait for event\n");
+		/*printf("wake up from wfe\n"); */

No commented out printf, thanks.

OK

#4 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

In reply to Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

---
 arch/arm/cpu/armv7/bcm281xx/Makefile        |   11 +
 arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c  |  525 ++++++++++++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-bsc.c       |   54 +++
 arch/arm/cpu/armv7/bcm281xx/clk-core.c      |  536 +++++++++++++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-core.h      |  510 +++++++++++++++++++++++++
 arch/arm/cpu/armv7/bcm281xx/clk-sdio.c      |   75 ++++
 arch/arm/cpu/armv7/bcm281xx/reset.c         |   29 ++
 arch/arm/include/asm/arch-bcm281xx/gpio.h   |   17 +
 arch/arm/include/asm/arch-bcm281xx/sysmap.h |   27 ++
 9 files changed, 1784 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/Makefile
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-bsc.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-core.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-core.h
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-sdio.c
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/reset.c
 create mode 100644 arch/arm/include/asm/arch-bcm281xx/gpio.h
 create mode 100644 arch/arm/include/asm/arch-bcm281xx/sysmap.h
arch/arm/cpu/armv7/bcm281xx/Makefile new file +11 -0
new file mode 100644
index 0000000..46c4943
@@ -0,0 +1,11 @@
+#
+# Copyright 2013 Broadcom Corporation.	All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= reset.o
+obj-y	+= clk-core.o
+obj-y	+= clk-bcm281xx.o
+obj-y	+= clk-sdio.o
+obj-y	+= clk-bsc.o
arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c new file +525 -0

525 lines not on this page · raw message

arch/arm/cpu/armv7/bcm281xx/clk-bsc.c new file +54 -0

54 lines not on this page · raw message

arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +536 -0

536 lines not on this page · raw message

arch/arm/cpu/armv7/bcm281xx/clk-core.h new file +510 -0

510 lines not on this page · raw message

arch/arm/cpu/armv7/bcm281xx/clk-sdio.c new file +75 -0

75 lines not on this page · raw message

arch/arm/cpu/armv7/bcm281xx/reset.c new file +29 -0
new file mode 100644
index 0000000..f66db5c
@@ -0,0 +1,29 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sysmap.h>
+
+#define	EN_MASK		0x08000000	/* Enable timer */
+#define	SRSTEN_MASK	0x04000000	/* Enable soft reset */
+#define	CLKS_SHIFT	20		/* Clock period shift */
+#define	LD_SHIFT	0		/* Reload value shift */
+
+void reset_cpu(ulong ignored)
+{
+	/*
+	 * Set WD enable, RST enable,
+	 * 3.9 msec clock period (8), reload value (8*3.9ms)
+	 */
+	u32 reg = EN_MASK + SRSTEN_MASK + (8 << CLKS_SHIFT) + (8 << LD_SHIFT);
+	writel(reg, SECWD2_BASE_ADDR);
+
+	while (1)
+		;	/* loop forever till reset */
+}
arch/arm/include/asm/arch-bcm281xx/gpio.h new file +17 -0
new file mode 100644
index 0000000..b0e7b60
@@ -0,0 +1,17 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#ifndef __ARCH_BCM281XX_GPIO_H
+#define __ARCH_BCM281XX_GPIO_H
+
+/*
+ * Empty file - cmd_gpio.c requires this. The implementation
+ * is in drivers/gpio/kona_gpio.c instead of inlined here.
+ */
+
+#endif
arch/arm/include/asm/arch-bcm281xx/sysmap.h new file +27 -0
new file mode 100644
index 0000000..20d391b
@@ -0,0 +1,27 @@
+/*****************************************************************************
+*
+* Copyright 2013 Broadcom Corporation.  All rights reserved.
+*
+* SPDX-License-Identifier:      GPL-2.0+
+*
+*****************************************************************************/
+
+#ifndef __ARCH_BCM281XX_SYSMAP_H
+
+#define BSC1_BASE_ADDR		0x3e016000
+#define BSC2_BASE_ADDR		0x3e017000
+#define BSC3_BASE_ADDR		0x3e018000
+#define GPIO2_BASE_ADDR		0x35003000
+#define KONA_MST_CLK_BASE_ADDR	0x3f001000
+#define KONA_SLV_CLK_BASE_ADDR	0x3e011000
+#define PMU_BSC_BASE_ADDR	0x3500d000
+#define PWRMGR_BASE_ADDR	0x35010000
+#define SDIO1_BASE_ADDR		0x3f180000
+#define SDIO2_BASE_ADDR		0x3f190000
+#define SDIO3_BASE_ADDR		0x3f1a0000
+#define SDIO4_BASE_ADDR		0x3f1b0000
+#define SECWD_BASE_ADDR		0x3500c000
+#define SECWD2_BASE_ADDR	0x35002f40
+#define TIMER_BASE_ADDR		0x3e00d000
+
+#endif
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

Quoted 4 lines · Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

[snip]

Quoted 11 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +11 -0
+/* Bitfield operations */
+
+/* Produces a mask of set bits covering a range of a 32-bit value */
+static inline u32 bitfield_mask(u32 shift, u32 width)
+{
+	return ((1 << width) - 1) << shift;
+}
+
+/* Extract the value of a bitfield found within a given register value */
+static inline u32 bitfield_extract(u32 reg_val, u32 shift, u32 width)
+{

arch/arm/cpu/armv7/bcm281xx/clk-core.c line 67

Quoted 10 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +10 -0
+	return (reg_val & bitfield_mask(shift, width)) >> shift;
+}
+
+/* Replace the value of a bitfield found within a given register value */
+static inline u32 bitfield_replace(u32 reg_val, u32 shift, u32 width, u32 val)
+{
+	u32 mask = bitfield_mask(shift, width);
+
+	return (reg_val & ~mask) | (val << shift);
+}

This all feels horribly generic, isn't there some linux header we've already got that I can't think off of the top of my head that gives us these kind of functions?

Review

Quoted 1 line
(quoted diff) +1 -0
+	clk_dbg("%s: %s\n", __func__, c->name);

Please juse use debug(...), here and elsewhere.

arch/arm/cpu/armv7/bcm281xx/clk-core.h line 39

Quoted 9 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.h new file +9 -0
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#ifndef container_of
+#define container_of(ptr, type, member) ({ \
+	const typeof(((type *)0)->member) * __mptr = (ptr); \
+	(type *)((char *)__mptr - offsetof(type, member)); })
+#endif

We already have these..

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140129/c6f1e0d8/attachment.pgp>
#6 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

Quoted 24 lines · Tom Rini
Quoted 4 lines · Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

[snip]

Quoted 17 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +17 -0
+/* Bitfield operations */
+
+/* Produces a mask of set bits covering a range of a 32-bit value */
+static inline u32 bitfield_mask(u32 shift, u32 width)
+{
+	return ((1 << width) - 1) << shift;
+}
+
+/* Extract the value of a bitfield found within a given register value */
+static inline u32 bitfield_extract(u32 reg_val, u32 shift, u32 width)
+{
+	return (reg_val & bitfield_mask(shift, width)) >> shift;
+}
+
+/* Replace the value of a bitfield found within a given register value */
+static inline u32 bitfield_replace(u32 reg_val, u32 shift, u32 width, u32 val)
+{
Quoted 8 lines

arch/arm/cpu/armv7/bcm281xx/clk-core.c line 67

Quoted 4 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +4 -0
+	u32 mask = bitfield_mask(shift, width);
+
+	return (reg_val & ~mask) | (val << shift);
+}

This all feels horribly generic, isn't there some linux header we've already got that I can't think off of the top of my head that gives us these kind of functions?

Hi Tom,

I had a similar feeling. There are files such as include/linux/bitops.h and arch/arm/include/asm/bitops.h and a host of others, but these seem single bit oriented, and don't provide the functionality here. The bcm281xx clock registers are a myriad of bit fields of different widths and positions, and the driver code is simpler because it uses these generic bitfield functions and data tables to describe the bitfields. Perhaps the bcm281xx clock register hardware has revealed the need for more functions like this now. I've searched through the tree for equivalent functions and they don't seem to exist, but I could be wrong. We could create include/bitfield.h with functions specifically for bitfield operations if it were warranted. But if it only ever got used by one driver, it might be wrong to make it generic. But my gut feel is that if we did create include/bitfield.h it probably would be used by others who wanted to take a similar data-driven approach to register fields. We would also have to make it non-u32 specific I imagine, possibly just 'int' types. Thanks.

Darwin

<snip>

#7 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

Quoted 37 lines · Darwin Rambo
Quoted 24 lines · Tom Rini
Quoted 4 lines · Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

[snip]

Quoted 17 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +17 -0
+/* Bitfield operations */
+
+/* Produces a mask of set bits covering a range of a 32-bit value */
+static inline u32 bitfield_mask(u32 shift, u32 width)
+{
+	return ((1 << width) - 1) << shift;
+}
+
+/* Extract the value of a bitfield found within a given register value */
+static inline u32 bitfield_extract(u32 reg_val, u32 shift, u32 width)
+{
+	return (reg_val & bitfield_mask(shift, width)) >> shift;
+}
+
+/* Replace the value of a bitfield found within a given register value */
+static inline u32 bitfield_replace(u32 reg_val, u32 shift, u32 width, u32 val)
+{
Quoted 8 lines

arch/arm/cpu/armv7/bcm281xx/clk-core.c line 67

Quoted 4 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +4 -0
+	u32 mask = bitfield_mask(shift, width);
+
+	return (reg_val & ~mask) | (val << shift);
+}

This all feels horribly generic, isn't there some linux header we've already got that I can't think off of the top of my head that gives us these kind of functions?

Hi Tom,

Quoted 16 lines

I had a similar feeling. There are files such as include/linux/bitops.h and arch/arm/include/asm/bitops.h and a host of others, but these seem single bit oriented, and don't provide the functionality here. The bcm281xx clock registers are a myriad of bit fields of different widths and positions, and the driver code is simpler because it uses these generic bitfield functions and data tables to describe the bitfields. Perhaps the bcm281xx clock register hardware has revealed the need for more functions like this now. I've searched through the tree for equivalent functions and they don't seem to exist, but I could be wrong. We could create include/bitfield.h with functions specifically for bitfield operations if it were warranted. But if it only ever got used by one driver, it might be wrong to make it generic. But my gut feel is that if we did create include/bitfield.h it probably would be used by others who wanted to take a similar data-driven approach to register fields. We would also have to make it non-u32 specific I imagine, possibly just 'int' types. Thanks.

With Matt chiming in on where this is within the kernel, lets go with creating a include/bitfield.h here. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140131/951f3268/attachment.pgp>
#8 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

Quoted 55 lines · Tom Rini
Quoted 37 lines · Darwin Rambo
Quoted 24 lines · Tom Rini
Quoted 4 lines · Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

[snip]

Quoted 17 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +17 -0
+/* Bitfield operations */
+
+/* Produces a mask of set bits covering a range of a 32-bit value */
+static inline u32 bitfield_mask(u32 shift, u32 width)
+{
+	return ((1 << width) - 1) << shift;
+}
+
+/* Extract the value of a bitfield found within a given register value */
+static inline u32 bitfield_extract(u32 reg_val, u32 shift, u32 width)
+{
+	return (reg_val & bitfield_mask(shift, width)) >> shift;
+}
+
+/* Replace the value of a bitfield found within a given register value */
+static inline u32 bitfield_replace(u32 reg_val, u32 shift, u32 width, u32 val)
+{
Quoted 8 lines

arch/arm/cpu/armv7/bcm281xx/clk-core.c line 67

Quoted 4 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +4 -0
+	u32 mask = bitfield_mask(shift, width);
+
+	return (reg_val & ~mask) | (val << shift);
+}

This all feels horribly generic, isn't there some linux header we've already got that I can't think off of the top of my head that gives us these kind of functions?

Hi Tom,

Quoted 16 lines

I had a similar feeling. There are files such as include/linux/bitops.h and arch/arm/include/asm/bitops.h and a host of others, but these seem single bit oriented, and don't provide the functionality here. The bcm281xx clock registers are a myriad of bit fields of different widths and positions, and the driver code is simpler because it uses these generic bitfield functions and data tables to describe the bitfields. Perhaps the bcm281xx clock register hardware has revealed the need for more functions like this now. I've searched through the tree for equivalent functions and they don't seem to exist, but I could be wrong. We could create include/bitfield.h with functions specifically for bitfield operations if it were warranted. But if it only ever got used by one driver, it might be wrong to make it generic. But my gut feel is that if we did create include/bitfield.h it probably would be used by others who wanted to take a similar data-driven approach to register fields. We would also have to make it non-u32 specific I imagine, possibly just 'int' types. Thanks.

Quoted 2 lines

With Matt chiming in on where this is within the kernel, lets go with creating a include/bitfield.h here. Thanks!

Will implement this and will try to remove the u32's everywhere. Thanks.

Quoted 1 line
#9 lore raw

PATCH 2/6 arch: bcm281xx: Initial commit of bcm281xx architecture code

In reply to Tom Rini
Quoted 24 lines · Tom Rini
Quoted 4 lines · Darwin Rambo

Add bcm281xx architecture support code including a clock framework and chip reset. Define register block base addresses for the bcm281xx architecture and create an empty gpio header file required when CONFIG_CMD_GPIO is set.

[snip]

Quoted 17 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +17 -0
+/* Bitfield operations */
+
+/* Produces a mask of set bits covering a range of a 32-bit value */
+static inline u32 bitfield_mask(u32 shift, u32 width)
+{
+	return ((1 << width) - 1) << shift;
+}
+
+/* Extract the value of a bitfield found within a given register value */
+static inline u32 bitfield_extract(u32 reg_val, u32 shift, u32 width)
+{
+	return (reg_val & bitfield_mask(shift, width)) >> shift;
+}
+
+/* Replace the value of a bitfield found within a given register value */
+static inline u32 bitfield_replace(u32 reg_val, u32 shift, u32 width, u32 val)
+{
Quoted 8 lines

arch/arm/cpu/armv7/bcm281xx/clk-core.c line 67

Quoted 4 lines
arch/arm/cpu/armv7/bcm281xx/clk-core.c new file +4 -0
+	u32 mask = bitfield_mask(shift, width);
+
+	return (reg_val & ~mask) | (val << shift);
+}

This all feels horribly generic, isn't there some linux header we've already got that I can't think off of the top of my head that gives us these kind of functions?

To add to what Darwin mentioned about bitops.h being insufficient...

The equivalent kernel implementations are wrapped up in the regmap/regmap-mmio helpers. That implementation is *very* heavyweight, and IMHO simply not appropriate for U-Boot (and often not useful in the kernel as well). A homegrown generic set of inline ops would seem to be ideal for U-Boot.

-Matt

#10 lore raw

PATCH 3/6 gpio: kona: Add Kona gpio driver

In reply to Darwin Rambo

Add support for the Kona GPIO controller found on Broadcom mobile SoCs.

---
 drivers/gpio/Makefile    |    1 +
 drivers/gpio/kona_gpio.c |  143 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)
 create mode 100644 drivers/gpio/kona_gpio.c
drivers/gpio/Makefile +1 -0
index b903c45..ed2c0c7 100644
@@ -8,6 +8,7 @@
 obj-$(CONFIG_AT91_GPIO)	+= at91_gpio.o
 obj-$(CONFIG_INTEL_ICH6_GPIO)	+= intel_ich6_gpio.o
 obj-$(CONFIG_KIRKWOOD_GPIO)	+= kw_gpio.o
+obj-$(CONFIG_KONA_GPIO)	+= kona_gpio.o
 obj-$(CONFIG_MARVELL_GPIO)	+= mvgpio.o
 obj-$(CONFIG_MARVELL_MFP)	+= mvmfp.o
 obj-$(CONFIG_MXC_GPIO)	+= mxc_gpio.o
drivers/gpio/kona_gpio.c new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#11 lore raw

PATCH 4/6 i2c: kona: Add Kona I2C driver

In reply to Darwin Rambo

Add support for the Kona I2C controller found on Broadcom mobile SoCs.

---
 drivers/i2c/Makefile   |    1 +
 drivers/i2c/kona_i2c.c |  730 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 731 insertions(+)
 create mode 100644 drivers/i2c/kona_i2c.c
drivers/i2c/Makefile +1 -0
index fa3a875..36d5e5f 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
 obj-$(CONFIG_SYS_I2C) += i2c_core.o
 obj-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
 obj-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
+obj-$(CONFIG_SYS_I2C_KONA) += kona_i2c.o
 obj-$(CONFIG_SYS_I2C_MXC) += mxc_i2c.o
 obj-$(CONFIG_SYS_I2C_OMAP24XX) += omap24xx_i2c.o
 obj-$(CONFIG_SYS_I2C_OMAP34XX) += omap24xx_i2c.o
drivers/i2c/kona_i2c.c new file +730 -0

730 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 5/6 mmc: kona: Add Kona mmc driver

In reply to Darwin Rambo

Add support for the Kona SDHCI found on Broadcom mobile SoCs.

---
 drivers/mmc/Makefile     |    1 +
 drivers/mmc/kona_sdhci.c |  127 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 drivers/mmc/kona_sdhci.c
drivers/mmc/Makefile +1 -0
index e793ed9..931922b 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
 obj-$(CONFIG_SDHCI) += sdhci.o
 obj-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
+obj-$(CONFIG_KONA_SDHCI) += kona_sdhci.o
 obj-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
 obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
 obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
drivers/mmc/kona_sdhci.c new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#13 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

In reply to Darwin Rambo

Add support for the bcm28155_ap reference board.

---
 board/broadcom/bcm28155_ap/Makefile      |    7 ++
 board/broadcom/bcm28155_ap/bcm28155_ap.c |   99 ++++++++++++++++++++
 boards.cfg                               |    1 +
 include/configs/bcm28155_ap.h            |  148 ++++++++++++++++++++++++++++++
 4 files changed, 255 insertions(+)
 create mode 100644 board/broadcom/bcm28155_ap/Makefile
 create mode 100644 board/broadcom/bcm28155_ap/bcm28155_ap.c
 create mode 100644 include/configs/bcm28155_ap.h
board/broadcom/bcm28155_ap/Makefile new file +7 -0
new file mode 100644
index 0000000..b6159dc
@@ -0,0 +1,7 @@
+#
+# Copyright 2013 Broadcom Corporation.	All rights reserved.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= $(BOARD).o
board/broadcom/bcm28155_ap/bcm28155_ap.c new file +99 -0

99 lines not on this page · raw message

boards.cfg +1 -0
index a8336cc..2105ecc 100644
@@ -271,6 +271,7 @@ Active  arm         armv7          am33xx      ti              ti816x
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_mmc                       sama5d3xek:SAMA5D3,SYS_USE_MMC                                                                                                    Bo Shen <[email protected]>
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_nandflash                 sama5d3xek:SAMA5D3,SYS_USE_NANDFLASH                                                                                              Bo Shen <[email protected]>
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_spiflash                  sama5d3xek:SAMA5D3,SYS_USE_SERIALFLASH                                                                                            Bo Shen <[email protected]>
+Active  arm         armv7          bcm281xx    broadcom        bcm28155_ap         bcm28155_ap                          bcm28155_ap                                                                                                                       Tim Kryger <[email protected]>
 Active  arm         armv7          exynos      samsung         arndale             arndale                              -                                                                                                                                 Inderpal Singh <[email protected]>
 Active  arm         armv7          exynos      samsung         origen              origen                               -                                                                                                                                 Chander Kashyap <[email protected]>
 Active  arm         armv7          exynos      samsung         smdk5250            smdk5250                             -                                                                                                                                 Chander Kashyap <[email protected]>
include/configs/bcm28155_ap.h new file +148 -0

148 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

Quoted 5 lines · Darwin Rambo

Add support for the bcm28155_ap reference board.

[snip]

board/broadcom/bcm28155_ap/bcm28155_ap.c line 60

Quoted 1 line
board/broadcom/bcm28155_ap/bcm28155_ap.c new file +1 -0
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;

Please use get_ram_size(...);

include/configs/bcm28155_ap.h line 76

Quoted 3 lines
include/configs/bcm28155_ap.h new file +3 -0
+/* Memory testing range */
+#define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + SZ_1M)

Please see doc/README.memory-test

include/configs/bcm28155_ap.h line 96

Quoted 2 lines
include/configs/bcm28155_ap.h new file +2 -0
+#define CONFIG_SYS_BAUDRATE_TABLE	{9600, 19200, 38400, 57600, \
+					115200, 230400, 460800, 921600}

Unless you really use those higher values in U-Boot, please use the default table.

Quoted 1 line

+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "

Unneeded now.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140129/2daa7a51/attachment.pgp>
#15 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

Quoted 11 lines · Tom Rini
Quoted 5 lines · Darwin Rambo

Add support for the bcm28155_ap reference board.

[snip]

board/broadcom/bcm28155_ap/bcm28155_ap.c line 60

Quoted 1 line
board/broadcom/bcm28155_ap/bcm28155_ap.c new file +1 -0
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;

Please use get_ram_size(...);

We tried using this on our reference board and it hangs accessing memory regions that are not populated. Our memory controller doesn't appear to properly support accessing regions that are not backed by physical sdram. So I think it's best to keep this code as is and consider this approach for future designs.

Quoted 6 lines

include/configs/bcm28155_ap.h line 76

Quoted 4 lines
include/configs/bcm28155_ap.h new file +3 -0
+/* Memory testing range */
+#define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + SZ_1M)

Please see doc/README.memory-test

OK. I think I'll disable CONFIG_CMD_MEMORY and remove this stuff.

Quoted 6 lines

include/configs/bcm28155_ap.h line 96

Quoted 3 lines
include/configs/bcm28155_ap.h new file +2 -0
+#define CONFIG_SYS_BAUDRATE_TABLE	{9600, 19200, 38400, 57600, \
+					115200, 230400, 460800, 921600}

Unless you really use those higher values in U-Boot, please use the default table.

OK

Quoted 4 lines
Quoted 2 lines

+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "

Unneeded now.

OK

Quoted 1 line
#16 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Darwin Rambo
Quoted 8 lines · Tom Rini
Quoted 5 lines · Darwin Rambo

Add support for the bcm28155_ap reference board.

Steve Rae <[email protected]> Reviewed-by: Tim Kryger <[email protected]>

[snip]

Quoted 8 lines
Quoted 3 lines

board/broadcom/bcm28155_ap/bcm28155_ap.c line 60

Quoted 1 line
board/broadcom/bcm28155_ap/bcm28155_ap.c new file +1 -0
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;

Please use get_ram_size(...);

We tried using this on our reference board and it hangs accessing memory regions that are not populated. Our memory controller doesn't appear to properly support accessing regions that are not backed by physical sdram. So I think it's best to keep this code as is and consider this approach for future designs.

Wait, what did you do? get_ram_size(base, max) must work and return CONFIG_SYS_SDRAM_SIZE, or you haven't properly configured your controller (as get_ram_size just pokes parts of the specified range).

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS67BgAAoJENk4IS6UOR1W5/sP/1oi/VC3Vd1Aa9R0Cn833caG ewiuDEWbuXVfa9+yeHIcr/VcyzEF16AxMqUpguaDukI34sdlUHxVlaJKDqLkMp/t fxNRQb8lNK6vhHK3F7xdKiMAFbvAm2fLDLii3mLAZjKGBU6/5kexSaKeklRJbmhz kyLRk3MejoXupNXRhHb48ZK9csgO7JHLNhQCwEIAxzuXhBbnw3Bjt09vBCET0Kfj no4o5TGH9kBOs2/DeO3zSqK3VqbSOgAH1uGYiaiC2cV9vni7Fdq1lshVI/Is+ete 0XkxxfD2pSAerUnQdyiaCJUWxomwLuPxxD/EcNkNMuEBHnOEnYHaNVA9FIdQGJRD GNIiR2UgtktHLedVRsUd19VyGEy3RVPW1urjy59hrU68P1WBxi20nEAxzWi+QuYy KefuYlZfiZ+rHO5P2SOJRPVgrCxcGEfBLztwaeTy2h54asCwctCyx7cwHDJJOkEk 7WtojfwaaaAsL0FGj1XK3hq/MeSjaK1zFOPsnuozZOXLUyEe0iElbqJVO2Ur0UD8 CJugsFM2ywJGsTkk3OvlW7uX1yoMQo5yvV0bNFWhj3XoGX7gpKxiZdFZZkqqc/7U HgTLP4fvLdXLbfdrHamEIQvWHztidsYNlkHdzts7Yzw1e5DszsO16+J/qW5NKcNI 4sfMcXpzoPqiX0WxpEEJ
=FNlU
-----END PGP SIGNATURE-----

#17 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

Quoted 10 lines · Tom Rini
Quoted 5 lines · Darwin Rambo

We tried using this on our reference board and it hangs accessing memory regions that are not populated. Our memory controller doesn't appear to properly support accessing regions that are not backed by physical sdram. So I think it's best to keep this code as is and consider this approach for future designs.

Wait, what did you do? get_ram_size(base, max) must work and return CONFIG_SYS_SDRAM_SIZE, or you haven't properly configured your controller (as get_ram_size just pokes parts of the specified range).

Tom,

In my experience, there are three general ways memory controllers behave when an access is made to an address that could be backed by RAM but isn't on a particular board.

1. All reads return a fixed pattern and writes are ignored
2. A bus error is triggered that the CPU sees as a data abort
3. No response to the transaction so the bus and CPU lock up

I believe the Broadcom memory controller can only behave in the third, least desirable way.

Thanks,
Tim Kryger

#18 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 18 lines · Tim Kryger
Quoted 10 lines · Tom Rini
Quoted 5 lines · Darwin Rambo

We tried using this on our reference board and it hangs accessing memory regions that are not populated. Our memory controller doesn't appear to properly support accessing regions that are not backed by physical sdram. So I think it's best to keep this code as is and consider this approach for future designs.

Wait, what did you do? get_ram_size(base, max) must work and return CONFIG_SYS_SDRAM_SIZE, or you haven't properly configured your controller (as get_ram_size just pokes parts of the specified range).

Tom,

In my experience, there are three general ways memory controllers behave when an access is made to an address that could be backed by RAM but isn't on a particular board.

Quoted 6 lines

1. All reads return a fixed pattern and writes are ignored
2. A bus error is triggered that the CPU sees as a data abort
3. No response to the transaction so the bus and CPU lock up

I believe the Broadcom memory controller can only behave in the third, least desirable way.

That's fine. You should still use get_ram_size(base, CONFIG_SYS_SDRAM_SIZE) like other platforms use as this go above the max size it's given. If this hangs, you have a problem with your configuration of the memory controller. Make sense?

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS69oUAAoJENk4IS6UOR1Wf/AP/2ApLwjAffxJ7LmEFFEK7hlr +dq1FW9ZRppfLRbfUrZz8Q/muyrx1ZuF9pIjjrFxLkNSLS3t8LZrJmfeswePqGC+ dq6qLl+ovk0VNYsxEhS77j1QQ/LLri67QCiGEZuS8vDB7qxiyuuCXkzyyW8hRFZ7 yfKpbfdRYpzWTJhAYnB0b1OaBi1jamsnjhXNU5XNa/H3PfDDofNA2fFQQfKbleOH BVOka1LP/+28gqKksEziM9cbcjPYJdE/FfY75nkbqKl9PWl+qIUZli90QO3Qdbgy uJJB1d3v6amfHZYbJymR3r8FoRjjCKxnCza5rCLpwFLxAKCUIIGHBFUGpvdcFoVa YctuEu2Dx2SgQ9dEGbLT1d2bsbfxOATEr5CyCpD7vD/9e/Ze7XaXALVKocfQmDbs 77s0YvHuXLGQPudPzYrEqPvgxf/NlNjeLj5IWqF++AE3j5U1sE26x95qk8jobMSn KjYGwzsxnd/gErqiYBawkrHxS2f4beAucsoprCh0WmSXiqSh6Wzc/+XlAIVSV7vm UE969gAzP1F2j37QfWR2/B0ILP27Pk3Ano8Dj2MIVKCAVkkpSQ5SCqAA7wvMzHej 801O52kArhG3/G/WrAbeLoQxKsdUyNI92+T0UaquTI4hRZk5GSvHQNCaZAcx6fCa hZ1o6zG9nMsp/yzVe7VZ
=0yIj
-----END PGP SIGNATURE-----

#19 lore raw

PATCH 6/6 board: bcm28155_ap: Add board files

Quoted 26 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 22 lines · Tim Kryger
Quoted 10 lines · Tom Rini
Quoted 5 lines · Darwin Rambo

We tried using this on our reference board and it hangs accessing memory regions that are not populated. Our memory controller doesn't appear to properly support accessing regions that are not backed by physical sdram. So I think it's best to keep this code as is and consider this approach for future designs.

Wait, what did you do? get_ram_size(base, max) must work and return CONFIG_SYS_SDRAM_SIZE, or you haven't properly configured your controller (as get_ram_size just pokes parts of the specified range).

Tom,

In my experience, there are three general ways memory controllers behave when an access is made to an address that could be backed by RAM but isn't on a particular board.

1. All reads return a fixed pattern and writes are ignored
2. A bus error is triggered that the CPU sees as a data abort
3. No response to the transaction so the bus and CPU lock up

Quoted 7 lines
Quoted 2 lines

I believe the Broadcom memory controller can only behave in the third, least desirable way.

That's fine. You should still use get_ram_size(base, CONFIG_SYS_SDRAM_SIZE) like other platforms use as this go above the max size it's given. If this hangs, you have a problem with your configuration of the memory controller. Make sense?

Yes. We have tested that this works and will implement this way. Thanks.

Quoted 22 lines

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS69oUAAoJENk4IS6UOR1Wf/AP/2ApLwjAffxJ7LmEFFEK7hlr +dq1FW9ZRppfLRbfUrZz8Q/muyrx1ZuF9pIjjrFxLkNSLS3t8LZrJmfeswePqGC+ dq6qLl+ovk0VNYsxEhS77j1QQ/LLri67QCiGEZuS8vDB7qxiyuuCXkzyyW8hRFZ7 yfKpbfdRYpzWTJhAYnB0b1OaBi1jamsnjhXNU5XNa/H3PfDDofNA2fFQQfKbleOH BVOka1LP/+28gqKksEziM9cbcjPYJdE/FfY75nkbqKl9PWl+qIUZli90QO3Qdbgy uJJB1d3v6amfHZYbJymR3r8FoRjjCKxnCza5rCLpwFLxAKCUIIGHBFUGpvdcFoVa YctuEu2Dx2SgQ9dEGbLT1d2bsbfxOATEr5CyCpD7vD/9e/Ze7XaXALVKocfQmDbs 77s0YvHuXLGQPudPzYrEqPvgxf/NlNjeLj5IWqF++AE3j5U1sE26x95qk8jobMSn KjYGwzsxnd/gErqiYBawkrHxS2f4beAucsoprCh0WmSXiqSh6Wzc/+XlAIVSV7vm UE969gAzP1F2j37QfWR2/B0ILP27Pk3Ano8Dj2MIVKCAVkkpSQ5SCqAA7wvMzHej 801O52kArhG3/G/WrAbeLoQxKsdUyNI92+T0UaquTI4hRZk5GSvHQNCaZAcx6fCa hZ1o6zG9nMsp/yzVe7VZ
=0yIj
-----END PGP SIGNATURE-----

#20 lore raw

cover Introducing the Broadcom bcm281xx Architecture

In reply to Darwin Rambo
Quoted 6 lines · Darwin Rambo

This patchset introduces the Broadcom bcm281xx family of mobile SoC chips. Broadcom kona hardware blocks are often found in Broadcom mobile SoC chips including the bcm281xx family, so support for some of these kona blocks is also provided here. These patches work on u-boot master as well as the u-boot-arm custodian tree.

Quoted 7 lines

Darwin Rambo (6):
arch: kona: Initial commit of kona-common architecture code
arch: bcm281xx: Initial commit of bcm281xx architecture code
gpio: kona: Add Kona gpio driver
i2c: kona: Add Kona I2C driver
mmc: kona: Add Kona mmc driver
board: bcm28155_ap: Add board files

Thanks for posting. Globally, please don't introduce another style for the file header,
/*
* This works
* just fine.
*
* Including what the file is about
*/

And I also see the incorrect style sprinkled throughout.

I saw some '#define<tab>' mixed in with '#define<space>', and some other things I'd have sworn checkpatch complains about, so please make sure things are checkpatch clean (except for very long printed strings, which are an exception to line length rules).

Finally, please CC the custodians for i2c/mmc for those drivers as they may have further comments than the above list.

Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140129/0e2a1f0e/attachment.pgp>
#21 lore raw

cover Introducing the Broadcom bcm281xx Architecture

Quoted 16 lines · Tom Rini
Quoted 6 lines · Darwin Rambo

This patchset introduces the Broadcom bcm281xx family of mobile SoC chips. Broadcom kona hardware blocks are often found in Broadcom mobile SoC chips including the bcm281xx family, so support for some of these kona blocks is also provided here. These patches work on u-boot master as well as the u-boot-arm custodian tree.

Quoted 7 lines

Darwin Rambo (6):
arch: kona: Initial commit of kona-common architecture code
arch: bcm281xx: Initial commit of bcm281xx architecture code
gpio: kona: Add Kona gpio driver
i2c: kona: Add Kona I2C driver
mmc: kona: Add Kona mmc driver
board: bcm28155_ap: Add board files

Quoted 8 lines

Thanks for posting. Globally, please don't introduce another style for the file header,
/*
* This works
* just fine.
*
* Including what the file is about
*/

OK - legacy stuff will be fixed.

Quoted 7 lines

And I also see the incorrect style sprinkled throughout.

I saw some '#define<tab>' mixed in with '#define<space>', and some other things I'd have sworn checkpatch complains about, so please make sure things are checkpatch clean (except for very long printed strings, which are an exception to line length rules).

Well, checkpatch was clean, so I think there's a problem with the tool. Another minor gripe is that checkpatch and "indent -linux" don't agree on everything, "int * foo" being one of them. :)

Quoted 3 lines

Finally, please CC the custodians for i2c/mmc for those drivers as they may have further comments than the above list.

OK. There are mmc, i2c and gpio drivers. I assume each driver gets a different CC:?

Quoted 3 lines

Thanks!

Thanks to you too!

#22 lore raw

cover Introducing the Broadcom bcm281xx Architecture

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Darwin Rambo

On 14-01-29 02:32 PM, Tom Rini wrote:

[snip]

Quoted 4 lines
Quoted 2 lines

Finally, please CC the custodians for i2c/mmc for those drivers as they may have further comments than the above list.

OK. There are mmc, i2c and gpio drivers. I assume each driver gets a different CC:?

Yes, see the Custodians wiki page.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS6/YyAAoJENk4IS6UOR1WeXIP/0Z6Bcj9og5clIbvoePilWOi qGW5N7hwa8V0qlxWCqUNxBf87x21a0Kb2AOXY5oCgYZrc/xJc3xu8dyfwQriXsrA M+q2+mnpa3ws+h5hjdza3dqFyiv/PyBWvdggmZY7W7TmzLZqjR/vmOfhoM9M0lz1 +Qk/WNp8l5lEGfBN5u1MzOkxq4GE4BMtjSRIfZehcrup/CKmziocVxauTbDudIBw SxkNvEYBzUgajcT2hK3GuQ3LEh/ZkXk5iCUsal4QXNiBk8NGrLYrbgb4HFPsgOyf +qza4xz81sWrf/vsjVlwDpta6f7SiPnTuCFuytUTwol8Yls8blrMCWfGv2c74lFS 0uyFYG7gRGX4kXzzA5hitmrhSLCpcDIQRkpDRXWa48mmeO9wU6kOeQj3nSu6twfo AyN99RbsOm7phY9RZcOxtdF+PwUDP5M9dJXHeKznAnXO3mP5kgboN/4Xtt71tq0x b/Bcg45fB/Fe9t2ob6FvQbUsvGUy+N2aWJj+vnZIw/0Pi+9kuiOjsf75W43MoT6C BRP6THFd29OSaNeiZEQjhVyFCxZFM7wHLpF8FN6+RHip4Di75SlBuT0zbr3duFIB kI6med8zgp1UP8nNxFJit/DhMlkT+P4Ng4p5fwSzMo/rOpt6msN1ukBypE1nudlO CHklHqLDA1+bLgjfiqm6
=kv/I
-----END PGP SIGNATURE-----