All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support.
@ 2014-09-30 22:57 Jon Fraser
  2014-10-01 15:28 ` Julien Grall
  2014-10-02 12:57 ` [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Ian Campbell
  0 siblings, 2 replies; 19+ messages in thread
From: Jon Fraser @ 2014-09-30 22:57 UTC (permalink / raw)
  To: xen-devel; +Cc: Jon Fraser

Relax cpu id mask to cover minor cpu revisions in the SoC versions.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 xen/arch/arm/arm32/proc-v7.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index b0d5343..2f3ff1e 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
         .section ".init.proc.info", #alloc, #execinstr
         .type __v7_brahma15mp_proc_info, #object
 __v7_brahma15mp_proc_info:
-        .long 0x420F00F2             /* Broadcom Brahma-B15 */
-        .long 0xFF0FFFFF             /* Mask */
+        .long 0x420F00F0             /* Broadcom Brahma-B15 */
+        .long 0xFF0FFFF0             /* Mask */
         .long brahma15mp_init
         .long caxx_processor
         .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support.
  2014-09-30 22:57 [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
@ 2014-10-01 15:28 ` Julien Grall
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
  2014-10-02 12:57 ` [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Ian Campbell
  1 sibling, 1 reply; 19+ messages in thread
From: Julien Grall @ 2014-10-01 15:28 UTC (permalink / raw)
  To: Jon Fraser, xen-devel, Ian Campbell, Stefano Stabellini, Tim Deegan

Hello Jon,

Thank you for adding support to a new board in Xen.

I don't find a cover letter, so I will make general comments here.

It's common to CC the relevant maintainers on the different patches. So,
we can directly now that we are concerned with the series. You can use
scripts/get_maintainers.pl for this purpose.

Also, I've noticed that your patches are not arrived threaded in my box,
it's harder for us to know that every patches belongs to the same
series. git send-email *your list of patch* should do the job for you.


On 09/30/2014 11:57 PM, Jon Fraser wrote:
> Relax cpu id mask to cover minor cpu revisions in the SoC versions.
> 
> Signed-off-by: Jon Fraser <jfraser@broadcom.com>

Reviewed-by: Julien Grall <julien.grall@linaro.org>

> ---
>  xen/arch/arm/arm32/proc-v7.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
> index b0d5343..2f3ff1e 100644
> --- a/xen/arch/arm/arm32/proc-v7.S
> +++ b/xen/arch/arm/arm32/proc-v7.S
> @@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
>          .section ".init.proc.info", #alloc, #execinstr
>          .type __v7_brahma15mp_proc_info, #object
>  __v7_brahma15mp_proc_info:
> -        .long 0x420F00F2             /* Broadcom Brahma-B15 */
> -        .long 0xFF0FFFFF             /* Mask */
> +        .long 0x420F00F0             /* Broadcom Brahma-B15 */
> +        .long 0xFF0FFFF0             /* Mask */
>          .long brahma15mp_init
>          .long caxx_processor
>          .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
> 

Regards,


-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support.
  2014-09-30 22:57 [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
  2014-10-01 15:28 ` Julien Grall
@ 2014-10-02 12:57 ` Ian Campbell
  2014-10-02 15:09   ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2014-10-02 12:57 UTC (permalink / raw)
  To: Jon Fraser, Konrad Rzeszutek Wilk; +Cc: xen-devel

On Tue, 2014-09-30 at 18:57 -0400, Jon Fraser wrote:
> Relax cpu id mask to cover minor cpu revisions in the SoC versions.
> 
> Signed-off-by: Jon Fraser <jfraser@broadcom.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Since we are now post feature freeze we will need a freeze exception
from the release manager (Konrad, CCd) for this series.

These first two patches in this series are practically bugfixes and I
think they should certainly go in:
        xen/arm: Broadcom 7445D0 ARM cpu support.
        xen/arm: Update early print console UART address for Broadcom 7445D0.
The third patch:
        xen/arm: Add support for Broadcom 7445D0 A15 platform.
        
Is somewhat larger but it is completely isolated and cannot break
anything which does not use the brcm,bcm7445d0 dtb compat string. So it
is completely safe wrt regressions on other platforms and I can't think
of a reason not to take it once it is ready.

> ---
>  xen/arch/arm/arm32/proc-v7.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
> index b0d5343..2f3ff1e 100644
> --- a/xen/arch/arm/arm32/proc-v7.S
> +++ b/xen/arch/arm/arm32/proc-v7.S
> @@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
>          .section ".init.proc.info", #alloc, #execinstr
>          .type __v7_brahma15mp_proc_info, #object
>  __v7_brahma15mp_proc_info:
> -        .long 0x420F00F2             /* Broadcom Brahma-B15 */
> -        .long 0xFF0FFFFF             /* Mask */
> +        .long 0x420F00F0             /* Broadcom Brahma-B15 */
> +        .long 0xFF0FFFF0             /* Mask */
>          .long brahma15mp_init
>          .long caxx_processor
>          .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support.
  2014-10-02 12:57 ` [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Ian Campbell
@ 2014-10-02 15:09   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 19+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-10-02 15:09 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Jon Fraser, xen-devel

On Thu, Oct 02, 2014 at 01:57:29PM +0100, Ian Campbell wrote:
> On Tue, 2014-09-30 at 18:57 -0400, Jon Fraser wrote:
> > Relax cpu id mask to cover minor cpu revisions in the SoC versions.
> > 
> > Signed-off-by: Jon Fraser <jfraser@broadcom.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Since we are now post feature freeze we will need a freeze exception
> from the release manager (Konrad, CCd) for this series.
> 
> These first two patches in this series are practically bugfixes and I
> think they should certainly go in:
>         xen/arm: Broadcom 7445D0 ARM cpu support.
>         xen/arm: Update early print console UART address for Broadcom 7445D0.
> The third patch:
>         xen/arm: Add support for Broadcom 7445D0 A15 platform.
>         
> Is somewhat larger but it is completely isolated and cannot break
> anything which does not use the brcm,bcm7445d0 dtb compat string. So it
> is completely safe wrt regressions on other platforms and I can't think
> of a reason not to take it once it is ready.

Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> > ---
> >  xen/arch/arm/arm32/proc-v7.S | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
> > index b0d5343..2f3ff1e 100644
> > --- a/xen/arch/arm/arm32/proc-v7.S
> > +++ b/xen/arch/arm/arm32/proc-v7.S
> > @@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
> >          .section ".init.proc.info", #alloc, #execinstr
> >          .type __v7_brahma15mp_proc_info, #object
> >  __v7_brahma15mp_proc_info:
> > -        .long 0x420F00F2             /* Broadcom Brahma-B15 */
> > -        .long 0xFF0FFFFF             /* Mask */
> > +        .long 0x420F00F0             /* Broadcom Brahma-B15 */
> > +        .long 0xFF0FFFF0             /* Mask */
> >          .long brahma15mp_init
> >          .long caxx_processor
> >          .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support
  2014-10-01 15:28 ` Julien Grall
@ 2014-10-02 22:16   ` Jon Fraser
  2014-10-02 22:16     ` [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
                       ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Jon Fraser @ 2014-10-02 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, ian.campbell, Jon Fraser, stefano.stabellini

Version 2

This patch series adds support for the Broadcom A15 boards based on the
7445D0 SoC. These changes only affect this single platform.

The existing code for .init.proc.info  and early UART support have been updated
from chip version C0 to D0.  Versions before D0 are not supported.

I believe I've addressed all of Julien's comments on brcm.c in the previous 
version.

Jon Fraser (4):
  xen/arm: Broadcom 7445D0 ARM cpu support.
  xen/arm: Update early print console UART address for Broadcom 7445D0.
  xen/arm: Add support for Broadcom 7445D0 A15 platform.
  xen/arm/docs:  Document Broadcom 7445D0 early printk support

 docs/misc/arm/early-printk.txt  |   1 +
 xen/arch/arm/Rules.mk           |   2 +-
 xen/arch/arm/arm32/proc-v7.S    |   4 +-
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 299 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/arm/platforms/brcm.c

-- 
1.9.0.138.g2de3478

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support.
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
@ 2014-10-02 22:16     ` Jon Fraser
  2014-10-03 10:39       ` Julien Grall
  2014-10-02 22:16     ` [PATCH V2 2/4] xen/arm: Update early print console UART address for Broadcom 7445D0 Jon Fraser
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Jon Fraser @ 2014-10-02 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, ian.campbell, Jon Fraser, stefano.stabellini

Relax cpu id mask to cover minor cpu revisions in the SoC versions.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 xen/arch/arm/arm32/proc-v7.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index b0d5343..2f3ff1e 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
         .section ".init.proc.info", #alloc, #execinstr
         .type __v7_brahma15mp_proc_info, #object
 __v7_brahma15mp_proc_info:
-        .long 0x420F00F2             /* Broadcom Brahma-B15 */
-        .long 0xFF0FFFFF             /* Mask */
+        .long 0x420F00F0             /* Broadcom Brahma-B15 */
+        .long 0xFF0FFFF0             /* Mask */
         .long brahma15mp_init
         .long caxx_processor
         .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V2 2/4] xen/arm: Update early print console UART address for Broadcom 7445D0.
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
  2014-10-02 22:16     ` [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
@ 2014-10-02 22:16     ` Jon Fraser
  2014-10-02 22:16     ` [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform Jon Fraser
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 19+ messages in thread
From: Jon Fraser @ 2014-10-02 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, ian.campbell, Jon Fraser, stefano.stabellini

The console UART address changed between chip versions C0 and D0.
Broadcom 7445[ABC]0 versions were not released and are not supported.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 xen/arch/arm/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 26fafa2..d369b40 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -86,7 +86,7 @@ EARLY_UART_REG_SHIFT := 2
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), brcm)
 EARLY_PRINTK_INC := 8250
-EARLY_UART_BASE_ADDRESS := 0xF0406B00
+EARLY_UART_BASE_ADDRESS := 0xF040AB00
 EARLY_UART_REG_SHIFT := 2
 endif
 ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm)
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform.
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
  2014-10-02 22:16     ` [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
  2014-10-02 22:16     ` [PATCH V2 2/4] xen/arm: Update early print console UART address for Broadcom 7445D0 Jon Fraser
@ 2014-10-02 22:16     ` Jon Fraser
  2014-10-03 10:44       ` Julien Grall
  2014-10-02 22:16     ` [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support Jon Fraser
  2014-10-03 10:29     ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Ian Campbell
  4 siblings, 1 reply; 19+ messages in thread
From: Jon Fraser @ 2014-10-02 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, ian.campbell, Jon Fraser, stefano.stabellini

This code supports the Broadcom 7445D0 32-bit A15 based platform.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 295 insertions(+)
 create mode 100644 xen/arch/arm/platforms/brcm.c

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 680364f..3b92dde 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -1,4 +1,5 @@
 obj-y += vexpress.o
+obj-$(CONFIG_ARM_32) += brcm.o
 obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
diff --git a/xen/arch/arm/platforms/brcm.c b/xen/arch/arm/platforms/brcm.c
new file mode 100644
index 0000000..a10de22
--- /dev/null
+++ b/xen/arch/arm/platforms/brcm.c
@@ -0,0 +1,294 @@
+/*
+ * xen/arch/arm/platforms/brcm.c
+ *
+ * Broadcom Platform startup.
+ *
+ * Jon Fraser  <jfraser@broadcom.com>
+ * Copyright (c) 2013-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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/platform.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
+#include <xen/delay.h>
+
+struct brcm_plat_regs {
+    uint32_t    hif_mask;
+    uint32_t    hif_cpu_reset_config;
+    uint32_t    hif_boot_continuation;
+    uint32_t    cpu0_pwr_zone_ctrl;
+    uint32_t    scratch_reg;
+};
+
+static u32 brcm_boot_continuation_pc;
+
+static struct brcm_plat_regs regs;
+
+static __init int brcm_get_dt_node(char *compat_str,
+                                   const struct dt_device_node **dn,
+                                   u32 *reg_base)
+{
+    const struct dt_device_node *node;
+    u64 reg_base_64;
+    int rc;
+
+    node = dt_find_compatible_node(NULL, NULL, compat_str);
+    if ( !node )
+    {
+        dprintk(XENLOG_ERR, "%s: missing \"%s\" node\n", __func__, compat_str);
+        return -ENOENT;
+    }
+
+    rc = dt_device_get_address(node, 0, &reg_base_64, NULL);
+    if ( rc )
+    {
+        dprintk(XENLOG_ERR, "%s: missing \"reg\" prop\n", __func__);
+        return rc;
+    }
+
+    if ( dn )
+        *dn = node;
+
+    if ( reg_base )
+        *reg_base = reg_base_64;
+
+    return 0;
+}
+
+static __init int brcm_populate_plat_regs(void)
+{
+    int rc;
+    const struct dt_device_node *node;
+    u32 reg_base;
+    u32 val;
+
+    rc = brcm_get_dt_node("brcm,brcmstb-cpu-biu-ctrl", &node, &reg_base);
+    if ( rc )
+        return rc;
+
+    if ( !dt_property_read_u32(node, "cpu-reset-config-reg", &val) )
+    {
+        dprintk(XENLOG_ERR, "Missing property \"cpu-reset-config-reg\"\n");
+        return -ENOENT;
+    }
+    regs.hif_cpu_reset_config = reg_base + val;
+
+    if ( !dt_property_read_u32(node, "cpu0-pwr-zone-ctrl-reg", &val) )
+    {
+        dprintk(XENLOG_ERR, "Missing property \"cpu0-pwr-zone-ctrl-reg\"\n");
+        return -ENOENT;
+    }
+    regs.cpu0_pwr_zone_ctrl = reg_base + val;
+
+    if ( !dt_property_read_u32(node, "scratch-reg", &val) )
+    {
+        dprintk(XENLOG_ERR, "Missing property \"scratch-reg\"\n");
+        return -ENOENT;
+    }
+    regs.scratch_reg = reg_base + val;
+
+    rc = brcm_get_dt_node("brcm,brcmstb-hif-continuation", NULL, &reg_base);
+    if ( rc )
+        return rc;
+
+    regs.hif_boot_continuation = reg_base;
+
+    dprintk(XENLOG_INFO, "hif_cpu_reset_config  : %08xh\n",
+                    regs.hif_cpu_reset_config);
+    dprintk(XENLOG_INFO, "cpu0_pwr_zone_ctrl    : %08xh\n",
+                    regs.cpu0_pwr_zone_ctrl);
+    dprintk(XENLOG_INFO, "hif_boot_continuation : %08xh\n",
+                    regs.hif_boot_continuation);
+    dprintk(XENLOG_INFO, "scratch_reg : %08xh\n",
+                    regs.scratch_reg);
+
+    return 0;
+}
+
+#define ZONE_PWR_UP_REQ   (1 << 10)
+#define ZONE_PWR_ON_STATE (1 << 26)
+
+static int brcm_cpu_power_on(int cpu)
+{
+    u32 tmp;
+    void __iomem *pwr_ctl;
+    unsigned int timeout;
+
+    dprintk(XENLOG_ERR, "%s: Power on cpu %d\n", __func__, cpu);
+
+    pwr_ctl = ioremap_nocache(regs.cpu0_pwr_zone_ctrl + (cpu * sizeof(u32)),
+                              sizeof(u32));
+
+    if ( !pwr_ctl )
+    {
+        dprintk(XENLOG_ERR, "%s: Unable to map \"cpu0_pwr_zone_ctrl\"\n",
+                        __func__);
+        return -EFAULT;
+    }
+
+    /* request core power on */
+    tmp = readl(pwr_ctl);
+    tmp |= ZONE_PWR_UP_REQ;
+    writel(tmp, pwr_ctl);
+
+    /*
+     * Wait for the cpu to power on.
+     * Wait a max of 10 msec.
+     */
+    timeout = 10;
+    tmp = readl(pwr_ctl);
+
+    while ( !(tmp & ZONE_PWR_ON_STATE) )
+    {
+        if ( timeout-- == 0 )
+            break;
+
+        mdelay(1);
+        tmp = readl(pwr_ctl);
+    }
+
+    iounmap(pwr_ctl);
+
+    if ( timeout == 0 )
+    {
+        dprintk(XENLOG_ERR, "CPU%d power enable failed", cpu);
+        return -ETIMEDOUT;
+    }
+
+    return 0;
+}
+
+static int brcm_cpu_release(u32 cpu)
+{
+    u32 tmp;
+    u32 __iomem *reg;
+
+    dprintk(XENLOG_INFO, "%s: Taking cpu %d out of reset \n", __func__, cpu);
+
+    reg = ioremap_nocache(regs.hif_cpu_reset_config, sizeof(u32));
+    if ( !reg )
+    {
+        dprintk(XENLOG_ERR, "%s: Unable to map \"hif_cpu_reset_config\"\n",
+                __func__);
+        return -EFAULT;
+    }
+
+    /* now take the cpu out of reset */
+    tmp = readl(reg);
+    tmp &= ~(1 << cpu);
+    writel(tmp, reg);
+
+    iounmap(reg);
+
+    return 0;
+}
+
+static int brcm_set_boot_continuation(u32 cpu, u32 pc)
+{
+    u32 __iomem *reg;
+    dprintk(XENLOG_INFO, "%s: cpu %d pc 0x%x\n", __func__, cpu, pc);
+
+    reg = ioremap_nocache(regs.hif_boot_continuation + (cpu * 2 * sizeof(u32)),
+                          2 * sizeof(u32));
+    if ( !reg )
+    {
+        dprintk(XENLOG_ERR, "%s: Unable to map \"hif_boot_continuation\"\n",
+                __func__);
+        return -EFAULT;
+    }
+
+    writel(0, reg);
+    writel(pc, reg + 1);
+
+    iounmap(reg);
+
+    return 0;
+}
+
+static int brcm_cpu_up(int cpu)
+{
+    int  rc;
+
+    rc = brcm_cpu_power_on(cpu);
+    if ( rc )
+        return rc;
+
+    rc = brcm_set_boot_continuation(cpu, brcm_boot_continuation_pc);
+    if ( rc )
+        return rc;
+
+   return brcm_cpu_release(cpu);
+}
+
+static int __init brcm_smp_init(void)
+{
+    u32 __iomem *scratch;
+    u32 target_pc;
+
+    scratch = ioremap_nocache(regs.scratch_reg, sizeof(u32));
+
+    if ( !scratch )
+    {
+        dprintk(XENLOG_ERR, "%s: Unable to map \"scratch_reg\"\n", __func__);
+        return -EFAULT;
+    }
+    /*
+     * The HIF CPU BIU CTRL Scratch Register is used to pass
+     * addresses between this code in xen and the boot helper.
+     * The helper puts its own entry point in the scratch register.
+     * That address is written to the cpu boot continuation registers.
+     * The helper expects xen to put xen's entry point back in the register.
+     * The helper will jump to that address.
+     * The helper is in SRAM, which will always be a 32 bit address.
+     */
+
+    brcm_boot_continuation_pc = readl(scratch);
+
+    target_pc = __pa(init_secondary);
+    writel(target_pc, scratch);
+
+    iounmap(scratch);
+
+    dprintk(XENLOG_INFO, "%s: target_pc 0x%x boot continuation pc 0x%x\n",
+            __func__, target_pc, brcm_boot_continuation_pc);
+
+    return 0;
+}
+
+static __init int brcm_init(void)
+{
+    return brcm_populate_plat_regs();
+}
+
+static const char const *brcm_dt_compat[] __initconst =
+{
+    "brcm,bcm7445d0",
+    NULL
+};
+
+PLATFORM_START(brcm, "Broadcom B15")
+    .compatible     = brcm_dt_compat,
+    .init           = brcm_init,
+    .smp_init       = brcm_smp_init,
+    .cpu_up         = brcm_cpu_up,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
                       ` (2 preceding siblings ...)
  2014-10-02 22:16     ` [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform Jon Fraser
@ 2014-10-02 22:16     ` Jon Fraser
  2014-10-03 10:41       ` Julien Grall
  2014-10-03 10:29     ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Ian Campbell
  4 siblings, 1 reply; 19+ messages in thread
From: Jon Fraser @ 2014-10-02 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, ian.campbell, Jon Fraser, stefano.stabellini

Use CONFIG_EARLY_PRINTK=brcm for Broadcom 7445D0 based boards.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
---
 docs/misc/arm/early-printk.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
index 1431751..3d5a8fd 100644
--- a/docs/misc/arm/early-printk.txt
+++ b/docs/misc/arm/early-printk.txt
@@ -16,6 +16,7 @@ where mach is the name of the machine:
   - omap5432: printk with UART3 on TI OMAP5432 processors
   - sun6i: printk with 8250 on Allwinner A31 processors
   - sun7i: printk with 8250 on Allwinner A20 processors
+  - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
 
 The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
 see there when adding support for new machines.
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support
  2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
                       ` (3 preceding siblings ...)
  2014-10-02 22:16     ` [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support Jon Fraser
@ 2014-10-03 10:29     ` Ian Campbell
  2014-10-03 10:42       ` Julien Grall
  2014-10-03 15:03       ` Jonathan Fraser
  4 siblings, 2 replies; 19+ messages in thread
From: Ian Campbell @ 2014-10-03 10:29 UTC (permalink / raw)
  To: Jon Fraser; +Cc: julien.grall, tim, stefano.stabellini, xen-devel

On Thu, 2014-10-02 at 18:16 -0400, Jon Fraser wrote:
> Version 2
> 
> This patch series adds support for the Broadcom A15 boards based on the
> 7445D0 SoC. These changes only affect this single platform.
> 
> The existing code for .init.proc.info  and early UART support have been updated
> from chip version C0 to D0.  Versions before D0 are not supported.
> 
> I believe I've addressed all of Julien's comments on brcm.c in the previous 
> version.
> 
> Jon Fraser (4):
>   xen/arm: Broadcom 7445D0 ARM cpu support.
>   xen/arm: Update early print console UART address for Broadcom 7445D0.
>   xen/arm: Add support for Broadcom 7445D0 A15 platform.
>   xen/arm/docs:  Document Broadcom 7445D0 early printk support

All acked + applied.

When reposting please could you collect any acked-/reviewed-by which
were given from the previous round (assuming you haven't made major
changes) into the commit log.

Also FWIW we would normally update the docs in the same patch as
updating the feature.

> 
>  docs/misc/arm/early-printk.txt  |   1 +
>  xen/arch/arm/Rules.mk           |   2 +-
>  xen/arch/arm/arm32/proc-v7.S    |   4 +-
>  xen/arch/arm/platforms/Makefile |   1 +
>  xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 299 insertions(+), 3 deletions(-)
>  create mode 100644 xen/arch/arm/platforms/brcm.c
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support.
  2014-10-02 22:16     ` [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
@ 2014-10-03 10:39       ` Julien Grall
  0 siblings, 0 replies; 19+ messages in thread
From: Julien Grall @ 2014-10-03 10:39 UTC (permalink / raw)
  To: Jon Fraser, xen-devel; +Cc: tim, ian.campbell, stefano.stabellini

Hello Jon,

On 02/10/2014 23:16, Jon Fraser wrote:
> Relax cpu id mask to cover minor cpu revisions in the SoC versions.
>
> Signed-off-by: Jon Fraser <jfraser@broadcom.com>

Ian and I already acked/reviewed this patch on the previous version.

When you send a new version of a patch, you need to carry the 
acked/reviewed by given on the previous versions. Unless there is big 
change in the patch.

Regards,

> ---
>   xen/arch/arm/arm32/proc-v7.S | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
> index b0d5343..2f3ff1e 100644
> --- a/xen/arch/arm/arm32/proc-v7.S
> +++ b/xen/arch/arm/arm32/proc-v7.S
> @@ -50,8 +50,8 @@ __v7_ca7mp_proc_info:
>           .section ".init.proc.info", #alloc, #execinstr
>           .type __v7_brahma15mp_proc_info, #object
>   __v7_brahma15mp_proc_info:
> -        .long 0x420F00F2             /* Broadcom Brahma-B15 */
> -        .long 0xFF0FFFFF             /* Mask */
> +        .long 0x420F00F0             /* Broadcom Brahma-B15 */
> +        .long 0xFF0FFFF0             /* Mask */
>           .long brahma15mp_init
>           .long caxx_processor
>           .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
>

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support
  2014-10-02 22:16     ` [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support Jon Fraser
@ 2014-10-03 10:41       ` Julien Grall
  0 siblings, 0 replies; 19+ messages in thread
From: Julien Grall @ 2014-10-03 10:41 UTC (permalink / raw)
  To: Jon Fraser, xen-devel; +Cc: tim, ian.campbell, stefano.stabellini

Hello Jon,

On 02/10/2014 23:16, Jon Fraser wrote:
> Use CONFIG_EARLY_PRINTK=brcm for Broadcom 7445D0 based boards.
>
> Signed-off-by: Jon Fraser <jfraser@broadcom.com>

You don't need to have a separate patch for the documentation.
I would merge this patch with patch #1.

With or without the merge:

Reviewed-by: Julien Grall <julien.grall@linaro.org>

Regards,

> ---
>   docs/misc/arm/early-printk.txt | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
> index 1431751..3d5a8fd 100644
> --- a/docs/misc/arm/early-printk.txt
> +++ b/docs/misc/arm/early-printk.txt
> @@ -16,6 +16,7 @@ where mach is the name of the machine:
>     - omap5432: printk with UART3 on TI OMAP5432 processors
>     - sun6i: printk with 8250 on Allwinner A31 processors
>     - sun7i: printk with 8250 on Allwinner A20 processors
> +  - brcm: printk with 8250 on Broadcom 7445D0 boards with A15 processors.
>
>   The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
>   see there when adding support for new machines.
>

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support
  2014-10-03 10:29     ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Ian Campbell
@ 2014-10-03 10:42       ` Julien Grall
  2014-10-03 15:03       ` Jonathan Fraser
  1 sibling, 0 replies; 19+ messages in thread
From: Julien Grall @ 2014-10-03 10:42 UTC (permalink / raw)
  To: Ian Campbell, Jon Fraser; +Cc: stefano.stabellini, tim, xen-devel



On 03/10/2014 11:29, Ian Campbell wrote:
> On Thu, 2014-10-02 at 18:16 -0400, Jon Fraser wrote:
>> Version 2
>>
>> This patch series adds support for the Broadcom A15 boards based on the
>> 7445D0 SoC. These changes only affect this single platform.
>>
>> The existing code for .init.proc.info  and early UART support have been updated
>> from chip version C0 to D0.  Versions before D0 are not supported.
>>
>> I believe I've addressed all of Julien's comments on brcm.c in the previous
>> version.
>>
>> Jon Fraser (4):
>>    xen/arm: Broadcom 7445D0 ARM cpu support.
>>    xen/arm: Update early print console UART address for Broadcom 7445D0.
>>    xen/arm: Add support for Broadcom 7445D0 A15 platform.
>>    xen/arm/docs:  Document Broadcom 7445D0 early printk support
>
> All acked + applied.
>
> When reposting please could you collect any acked-/reviewed-by which
> were given from the previous round (assuming you haven't made major
> changes) into the commit log.
>
> Also FWIW we would normally update the docs in the same patch as
> updating the feature.

Oops, I haven't read your answer to the cover letter before reading the 
patch series.

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform.
  2014-10-02 22:16     ` [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform Jon Fraser
@ 2014-10-03 10:44       ` Julien Grall
  2014-10-03 15:15         ` Jonathan Fraser
  0 siblings, 1 reply; 19+ messages in thread
From: Julien Grall @ 2014-10-03 10:44 UTC (permalink / raw)
  To: Jon Fraser, xen-devel; +Cc: tim, ian.campbell, stefano.stabellini

Hello Jon,

On 02/10/2014 23:16, Jon Fraser wrote:
> This code supports the Broadcom 7445D0 32-bit A15 based platform.

While this patch has been acked and applied. Did you check that the (by 
default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or 
another device on your platform?

Regards,

> Signed-off-by: Jon Fraser <jfraser@broadcom.com>
> ---
>   xen/arch/arm/platforms/Makefile |   1 +
>   xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 295 insertions(+)
>   create mode 100644 xen/arch/arm/platforms/brcm.c
>
> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> index 680364f..3b92dde 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -1,4 +1,5 @@
>   obj-y += vexpress.o
> +obj-$(CONFIG_ARM_32) += brcm.o
>   obj-$(CONFIG_ARM_32) += exynos5.o
>   obj-$(CONFIG_ARM_32) += midway.o
>   obj-$(CONFIG_ARM_32) += omap5.o
> diff --git a/xen/arch/arm/platforms/brcm.c b/xen/arch/arm/platforms/brcm.c
> new file mode 100644
> index 0000000..a10de22
> --- /dev/null
> +++ b/xen/arch/arm/platforms/brcm.c
> @@ -0,0 +1,294 @@
> +/*
> + * xen/arch/arm/platforms/brcm.c
> + *
> + * Broadcom Platform startup.
> + *
> + * Jon Fraser  <jfraser@broadcom.com>
> + * Copyright (c) 2013-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; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/platform.h>
> +#include <xen/mm.h>
> +#include <xen/vmap.h>
> +#include <asm/io.h>
> +#include <xen/delay.h>
> +
> +struct brcm_plat_regs {
> +    uint32_t    hif_mask;
> +    uint32_t    hif_cpu_reset_config;
> +    uint32_t    hif_boot_continuation;
> +    uint32_t    cpu0_pwr_zone_ctrl;
> +    uint32_t    scratch_reg;
> +};
> +
> +static u32 brcm_boot_continuation_pc;
> +
> +static struct brcm_plat_regs regs;
> +
> +static __init int brcm_get_dt_node(char *compat_str,
> +                                   const struct dt_device_node **dn,
> +                                   u32 *reg_base)
> +{
> +    const struct dt_device_node *node;
> +    u64 reg_base_64;
> +    int rc;
> +
> +    node = dt_find_compatible_node(NULL, NULL, compat_str);
> +    if ( !node )
> +    {
> +        dprintk(XENLOG_ERR, "%s: missing \"%s\" node\n", __func__, compat_str);
> +        return -ENOENT;
> +    }
> +
> +    rc = dt_device_get_address(node, 0, &reg_base_64, NULL);
> +    if ( rc )
> +    {
> +        dprintk(XENLOG_ERR, "%s: missing \"reg\" prop\n", __func__);
> +        return rc;
> +    }
> +
> +    if ( dn )
> +        *dn = node;
> +
> +    if ( reg_base )
> +        *reg_base = reg_base_64;
> +
> +    return 0;
> +}
> +
> +static __init int brcm_populate_plat_regs(void)
> +{
> +    int rc;
> +    const struct dt_device_node *node;
> +    u32 reg_base;
> +    u32 val;
> +
> +    rc = brcm_get_dt_node("brcm,brcmstb-cpu-biu-ctrl", &node, &reg_base);
> +    if ( rc )
> +        return rc;
> +
> +    if ( !dt_property_read_u32(node, "cpu-reset-config-reg", &val) )
> +    {
> +        dprintk(XENLOG_ERR, "Missing property \"cpu-reset-config-reg\"\n");
> +        return -ENOENT;
> +    }
> +    regs.hif_cpu_reset_config = reg_base + val;
> +
> +    if ( !dt_property_read_u32(node, "cpu0-pwr-zone-ctrl-reg", &val) )
> +    {
> +        dprintk(XENLOG_ERR, "Missing property \"cpu0-pwr-zone-ctrl-reg\"\n");
> +        return -ENOENT;
> +    }
> +    regs.cpu0_pwr_zone_ctrl = reg_base + val;
> +
> +    if ( !dt_property_read_u32(node, "scratch-reg", &val) )
> +    {
> +        dprintk(XENLOG_ERR, "Missing property \"scratch-reg\"\n");
> +        return -ENOENT;
> +    }
> +    regs.scratch_reg = reg_base + val;
> +
> +    rc = brcm_get_dt_node("brcm,brcmstb-hif-continuation", NULL, &reg_base);
> +    if ( rc )
> +        return rc;
> +
> +    regs.hif_boot_continuation = reg_base;
> +
> +    dprintk(XENLOG_INFO, "hif_cpu_reset_config  : %08xh\n",
> +                    regs.hif_cpu_reset_config);
> +    dprintk(XENLOG_INFO, "cpu0_pwr_zone_ctrl    : %08xh\n",
> +                    regs.cpu0_pwr_zone_ctrl);
> +    dprintk(XENLOG_INFO, "hif_boot_continuation : %08xh\n",
> +                    regs.hif_boot_continuation);
> +    dprintk(XENLOG_INFO, "scratch_reg : %08xh\n",
> +                    regs.scratch_reg);
> +
> +    return 0;
> +}
> +
> +#define ZONE_PWR_UP_REQ   (1 << 10)
> +#define ZONE_PWR_ON_STATE (1 << 26)
> +
> +static int brcm_cpu_power_on(int cpu)
> +{
> +    u32 tmp;
> +    void __iomem *pwr_ctl;
> +    unsigned int timeout;
> +
> +    dprintk(XENLOG_ERR, "%s: Power on cpu %d\n", __func__, cpu);
> +
> +    pwr_ctl = ioremap_nocache(regs.cpu0_pwr_zone_ctrl + (cpu * sizeof(u32)),
> +                              sizeof(u32));
> +
> +    if ( !pwr_ctl )
> +    {
> +        dprintk(XENLOG_ERR, "%s: Unable to map \"cpu0_pwr_zone_ctrl\"\n",
> +                        __func__);
> +        return -EFAULT;
> +    }
> +
> +    /* request core power on */
> +    tmp = readl(pwr_ctl);
> +    tmp |= ZONE_PWR_UP_REQ;
> +    writel(tmp, pwr_ctl);
> +
> +    /*
> +     * Wait for the cpu to power on.
> +     * Wait a max of 10 msec.
> +     */
> +    timeout = 10;
> +    tmp = readl(pwr_ctl);
> +
> +    while ( !(tmp & ZONE_PWR_ON_STATE) )
> +    {
> +        if ( timeout-- == 0 )
> +            break;
> +
> +        mdelay(1);
> +        tmp = readl(pwr_ctl);
> +    }
> +
> +    iounmap(pwr_ctl);
> +
> +    if ( timeout == 0 )
> +    {
> +        dprintk(XENLOG_ERR, "CPU%d power enable failed", cpu);
> +        return -ETIMEDOUT;
> +    }
> +
> +    return 0;
> +}
> +
> +static int brcm_cpu_release(u32 cpu)
> +{
> +    u32 tmp;
> +    u32 __iomem *reg;
> +
> +    dprintk(XENLOG_INFO, "%s: Taking cpu %d out of reset \n", __func__, cpu);
> +
> +    reg = ioremap_nocache(regs.hif_cpu_reset_config, sizeof(u32));
> +    if ( !reg )
> +    {
> +        dprintk(XENLOG_ERR, "%s: Unable to map \"hif_cpu_reset_config\"\n",
> +                __func__);
> +        return -EFAULT;
> +    }
> +
> +    /* now take the cpu out of reset */
> +    tmp = readl(reg);
> +    tmp &= ~(1 << cpu);
> +    writel(tmp, reg);
> +
> +    iounmap(reg);
> +
> +    return 0;
> +}
> +
> +static int brcm_set_boot_continuation(u32 cpu, u32 pc)
> +{
> +    u32 __iomem *reg;
> +    dprintk(XENLOG_INFO, "%s: cpu %d pc 0x%x\n", __func__, cpu, pc);
> +
> +    reg = ioremap_nocache(regs.hif_boot_continuation + (cpu * 2 * sizeof(u32)),
> +                          2 * sizeof(u32));
> +    if ( !reg )
> +    {
> +        dprintk(XENLOG_ERR, "%s: Unable to map \"hif_boot_continuation\"\n",
> +                __func__);
> +        return -EFAULT;
> +    }
> +
> +    writel(0, reg);
> +    writel(pc, reg + 1);
> +
> +    iounmap(reg);
> +
> +    return 0;
> +}
> +
> +static int brcm_cpu_up(int cpu)
> +{
> +    int  rc;
> +
> +    rc = brcm_cpu_power_on(cpu);
> +    if ( rc )
> +        return rc;
> +
> +    rc = brcm_set_boot_continuation(cpu, brcm_boot_continuation_pc);
> +    if ( rc )
> +        return rc;
> +
> +   return brcm_cpu_release(cpu);
> +}
> +
> +static int __init brcm_smp_init(void)
> +{
> +    u32 __iomem *scratch;
> +    u32 target_pc;
> +
> +    scratch = ioremap_nocache(regs.scratch_reg, sizeof(u32));
> +
> +    if ( !scratch )
> +    {
> +        dprintk(XENLOG_ERR, "%s: Unable to map \"scratch_reg\"\n", __func__);
> +        return -EFAULT;
> +    }
> +    /*
> +     * The HIF CPU BIU CTRL Scratch Register is used to pass
> +     * addresses between this code in xen and the boot helper.
> +     * The helper puts its own entry point in the scratch register.
> +     * That address is written to the cpu boot continuation registers.
> +     * The helper expects xen to put xen's entry point back in the register.
> +     * The helper will jump to that address.
> +     * The helper is in SRAM, which will always be a 32 bit address.
> +     */
> +
> +    brcm_boot_continuation_pc = readl(scratch);
> +
> +    target_pc = __pa(init_secondary);
> +    writel(target_pc, scratch);
> +
> +    iounmap(scratch);
> +
> +    dprintk(XENLOG_INFO, "%s: target_pc 0x%x boot continuation pc 0x%x\n",
> +            __func__, target_pc, brcm_boot_continuation_pc);
> +
> +    return 0;
> +}
> +
> +static __init int brcm_init(void)
> +{
> +    return brcm_populate_plat_regs();
> +}
> +
> +static const char const *brcm_dt_compat[] __initconst =
> +{
> +    "brcm,bcm7445d0",
> +    NULL
> +};
> +
> +PLATFORM_START(brcm, "Broadcom B15")
> +    .compatible     = brcm_dt_compat,
> +    .init           = brcm_init,
> +    .smp_init       = brcm_smp_init,
> +    .cpu_up         = brcm_cpu_up,
> +PLATFORM_END
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
>

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support
  2014-10-03 10:29     ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Ian Campbell
  2014-10-03 10:42       ` Julien Grall
@ 2014-10-03 15:03       ` Jonathan Fraser
  2014-10-03 15:29         ` Ian Campbell
  1 sibling, 1 reply; 19+ messages in thread
From: Jonathan Fraser @ 2014-10-03 15:03 UTC (permalink / raw)
  To: Ian Campbell
  Cc: stefano.stabellini, Jonathan Fraser, tim, julien.grall, xen-devel

On Fri, 2014-10-03 at 11:29 +0100, Ian Campbell wrote:
> On Thu, 2014-10-02 at 18:16 -0400, Jon Fraser wrote:
> > Version 2
> > 
> > This patch series adds support for the Broadcom A15 boards based on the
> > 7445D0 SoC. These changes only affect this single platform.
> > 
> > The existing code for .init.proc.info  and early UART support have been updated
> > from chip version C0 to D0.  Versions before D0 are not supported.
> > 
> > I believe I've addressed all of Julien's comments on brcm.c in the previous 
> > version.
> > 
> > Jon Fraser (4):
> >   xen/arm: Broadcom 7445D0 ARM cpu support.
> >   xen/arm: Update early print console UART address for Broadcom 7445D0.
> >   xen/arm: Add support for Broadcom 7445D0 A15 platform.
> >   xen/arm/docs:  Document Broadcom 7445D0 early printk support
> 
> All acked + applied.
> 
> When reposting please could you collect any acked-/reviewed-by which
> were given from the previous round (assuming you haven't made major
> changes) into the commit log.
> 
> Also FWIW we would normally update the docs in the same patch as
> updating the feature.
> 

I was unsure of the protocol for previously reviewed patches in a
series.  I didn't merge the doc patch with the previous in case it had
already been applied.


Thanks
Jon

> > 
> >  docs/misc/arm/early-printk.txt  |   1 +
> >  xen/arch/arm/Rules.mk           |   2 +-
> >  xen/arch/arm/arm32/proc-v7.S    |   4 +-
> >  xen/arch/arm/platforms/Makefile |   1 +
> >  xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
> >  5 files changed, 299 insertions(+), 3 deletions(-)
> >  create mode 100644 xen/arch/arm/platforms/brcm.c
> > 
> 
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform.
  2014-10-03 10:44       ` Julien Grall
@ 2014-10-03 15:15         ` Jonathan Fraser
  2014-10-03 15:22           ` Ian Campbell
  0 siblings, 1 reply; 19+ messages in thread
From: Jonathan Fraser @ 2014-10-03 15:15 UTC (permalink / raw)
  To: Julien Grall
  Cc: Jonathan Fraser, tim, ian.campbell, stefano.stabellini, xen-devel


On Fri, 2014-10-03 at 11:44 +0100, Julien Grall wrote:
> Hello Jon,
> 
> On 02/10/2014 23:16, Jon Fraser wrote:
> > This code supports the Broadcom 7445D0 32-bit A15 based platform.
> 
> While this patch has been acked and applied. Did you check that the (by 
> default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or 
> another device on your platform?
> 
> Regards,
> 

I had a question about that.  This is a guest physical address, not the
machine physical address?  What are the restrictions?

On our current platforms, memory always starts at 0 and we currently
support between 1 and 6 GB.  There's always a 1GB hole at 0xc0000000.

However in the future, memory will start at 0x40000000 and extend
contiguously past 32-bit space for up to 4GB of memory, then segmented
in 36-bit address space.

I haven't tried a guest with much more than 1GB of memory, but will
try that today.

Thanks,
Jon

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform.
  2014-10-03 15:15         ` Jonathan Fraser
@ 2014-10-03 15:22           ` Ian Campbell
  2014-10-03 15:45             ` Jonathan Fraser
  0 siblings, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2014-10-03 15:22 UTC (permalink / raw)
  To: Jonathan Fraser; +Cc: Julien Grall, tim, stefano.stabellini, xen-devel

On Fri, 2014-10-03 at 15:15 +0000, Jonathan Fraser wrote:
> On Fri, 2014-10-03 at 11:44 +0100, Julien Grall wrote:
> > Hello Jon,
> > 
> > On 02/10/2014 23:16, Jon Fraser wrote:
> > > This code supports the Broadcom 7445D0 32-bit A15 based platform.
> > 
> > While this patch has been acked and applied. Did you check that the (by 
> > default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or 
> > another device on your platform?
> > 
> > Regards,
> > 
> 
> I had a question about that.  This is a guest physical address, not the
> machine physical address?

It's guest physical but dom0 is mapped 1:1 so that is somewhat the same
as machine physical in this instance.

>   What are the restrictions?

It just needs to be a hole in the address space which isn't used for
anything else, so not RAM and not MMIO.

Since dom0 is 1:1 mapped for MMIO this means a hole in the machine
address map, or as a last resort an address used by something which
isn't given to dom0.

In 4.6 we are going to sort out a way of finding these addresses
automatically, so the suckitude of having to figure one out will go
away...

> On our current platforms, memory always starts at 0 and we currently
> support between 1 and 6 GB.  There's always a 1GB hole at 0xc0000000.

I suppose this is an MMIO hole? Any free space in thatregion would do.

> However in the future, memory will start at 0x40000000 and extend
> contiguously past 32-bit space for up to 4GB of memory, then segmented
> in 36-bit address space.

In this case I guess the MMIO has moved to 0...0x40000000? Might need to
move the gnttab then too, or maybe we'll have fixed this in the core by
then (fingers crossed!)

> I haven't tried a guest with much more than 1GB of memory, but will
> try that today.
> 
> Thanks,
> Jon
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support
  2014-10-03 15:03       ` Jonathan Fraser
@ 2014-10-03 15:29         ` Ian Campbell
  0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2014-10-03 15:29 UTC (permalink / raw)
  To: Jonathan Fraser; +Cc: xen-devel, julien.grall, tim, stefano.stabellini

On Fri, 2014-10-03 at 15:03 +0000, Jonathan Fraser wrote:
> On Fri, 2014-10-03 at 11:29 +0100, Ian Campbell wrote:
> > On Thu, 2014-10-02 at 18:16 -0400, Jon Fraser wrote:
> > > Version 2
> > > 
> > > This patch series adds support for the Broadcom A15 boards based on the
> > > 7445D0 SoC. These changes only affect this single platform.
> > > 
> > > The existing code for .init.proc.info  and early UART support have been updated
> > > from chip version C0 to D0.  Versions before D0 are not supported.
> > > 
> > > I believe I've addressed all of Julien's comments on brcm.c in the previous 
> > > version.
> > > 
> > > Jon Fraser (4):
> > >   xen/arm: Broadcom 7445D0 ARM cpu support.
> > >   xen/arm: Update early print console UART address for Broadcom 7445D0.
> > >   xen/arm: Add support for Broadcom 7445D0 A15 platform.
> > >   xen/arm/docs:  Document Broadcom 7445D0 early printk support
> > 
> > All acked + applied.
> > 
> > When reposting please could you collect any acked-/reviewed-by which
> > were given from the previous round (assuming you haven't made major
> > changes) into the commit log.
> > 
> > Also FWIW we would normally update the docs in the same patch as
> > updating the feature.
> > 
> 
> I was unsure of the protocol for previously reviewed patches in a
> series.  I didn't merge the doc patch with the previous in case it had
> already been applied.

http://wiki.xen.org/wiki/Submitting_Xen_Patches has some info on this,
including how to tell if something has been merged by looking at the
staging branch. The section header doesn't necessarily suggest it will
tell you this though -- I'll try and make it more obvious...

Ian.
> 
> 
> Thanks
> Jon
> 
> > > 
> > >  docs/misc/arm/early-printk.txt  |   1 +
> > >  xen/arch/arm/Rules.mk           |   2 +-
> > >  xen/arch/arm/arm32/proc-v7.S    |   4 +-
> > >  xen/arch/arm/platforms/Makefile |   1 +
> > >  xen/arch/arm/platforms/brcm.c   | 294 ++++++++++++++++++++++++++++++++++++++++
> > >  5 files changed, 299 insertions(+), 3 deletions(-)
> > >  create mode 100644 xen/arch/arm/platforms/brcm.c
> > > 
> > 
> > 
> > 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform.
  2014-10-03 15:22           ` Ian Campbell
@ 2014-10-03 15:45             ` Jonathan Fraser
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Fraser @ 2014-10-03 15:45 UTC (permalink / raw)
  To: Ian Campbell
  Cc: stefano.stabellini, Jonathan Fraser, tim, Julien Grall, xen-devel

On Fri, 2014-10-03 at 16:22 +0100, Ian Campbell wrote:
> On Fri, 2014-10-03 at 15:15 +0000, Jonathan Fraser wrote:
> > On Fri, 2014-10-03 at 11:44 +0100, Julien Grall wrote:
> > > Hello Jon,
> > > 
> > > On 02/10/2014 23:16, Jon Fraser wrote:
> > > > This code supports the Broadcom 7445D0 32-bit A15 based platform.
> > > 
> > > While this patch has been acked and applied. Did you check that the (by 
> > > default mapped 0xb0000000-0xb0020000) doesn't overlap to the RAM or 
> > > another device on your platform?
> > > 
> > > Regards,
> > > 
> > 
> > I had a question about that.  This is a guest physical address, not the
> > machine physical address?
> 
> It's guest physical but dom0 is mapped 1:1 so that is somewhat the same
> as machine physical in this instance.
> 
> >   What are the restrictions?
> 
> It just needs to be a hole in the address space which isn't used for
> anything else, so not RAM and not MMIO.
> 
> Since dom0 is 1:1 mapped for MMIO this means a hole in the machine
> address map, or as a last resort an address used by something which
> isn't given to dom0.
> 
> In 4.6 we are going to sort out a way of finding these addresses
> automatically, so the suckitude of having to figure one out will go
> away...
> 
> > On our current platforms, memory always starts at 0 and we currently
> > support between 1 and 6 GB.  There's always a 1GB hole at 0xc0000000.
> 
> I suppose this is an MMIO hole? Any free space in thatregion would do.

Yes, it has MMIO, flash, SROM, SRAM, PCI and some empty space.
> 
> > However in the future, memory will start at 0x40000000 and extend
> > contiguously past 32-bit space for up to 4GB of memory, then segmented
> > in 36-bit address space.
> 
> In this case I guess the MMIO has moved to 0...0x40000000? Might need to
> move the gnttab then too, or maybe we'll have fixed this in the core by
> then (fingers crossed!)
> 


Yes, everything that was at 0xc... moved to 0x0, starting with the boot
vector and flash.  This will also be the map for 64-bit systems.
These new parts will have new part numbers and DTBs.

> > I haven't tried a guest with much more than 1GB of memory, but will
> > try that today.
> > 
> > Thanks,
> > Jon
> > 
> > 
> 
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-10-03 15:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 22:57 [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
2014-10-01 15:28 ` Julien Grall
2014-10-02 22:16   ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Jon Fraser
2014-10-02 22:16     ` [PATCH V2 1/4] xen/arm: Broadcom 7445D0 ARM cpu support Jon Fraser
2014-10-03 10:39       ` Julien Grall
2014-10-02 22:16     ` [PATCH V2 2/4] xen/arm: Update early print console UART address for Broadcom 7445D0 Jon Fraser
2014-10-02 22:16     ` [PATCH V2 3/4] xen/arm: Add support for Broadcom 7445D0 A15 platform Jon Fraser
2014-10-03 10:44       ` Julien Grall
2014-10-03 15:15         ` Jonathan Fraser
2014-10-03 15:22           ` Ian Campbell
2014-10-03 15:45             ` Jonathan Fraser
2014-10-02 22:16     ` [PATCH V2 4/4] xen/arm/docs: Document Broadcom 7445D0 early printk support Jon Fraser
2014-10-03 10:41       ` Julien Grall
2014-10-03 10:29     ` [PATCH V2 0/4] Add Broadcom 7445D0 A15 board support Ian Campbell
2014-10-03 10:42       ` Julien Grall
2014-10-03 15:03       ` Jonathan Fraser
2014-10-03 15:29         ` Ian Campbell
2014-10-02 12:57 ` [PATCH 1/3] xen/arm: Broadcom 7445D0 ARM cpu support Ian Campbell
2014-10-02 15:09   ` Konrad Rzeszutek Wilk

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.