[Qemu-devel] [PATCH] Add code to connect to external panel, for ARM

2017-05-30 Thread John Bradley via Qemu-devel
>From 5f5c186162ef5f56872095318106e9fe360ae310 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Tue, 23 May 2017 01:43:32 +0100
Subject: [PATCH] Add code to connect to external panel, for ARM

Has no effect if panel not found.

GDummyPanel Fix formating issues.

Add inital discussion of protocol version.

Add code to connect with https://github.com/flypie/GDummyPanel The code uses 
GNU Sockets & Windows
sockets as on MINGW GNU no available. This is inteded as a Demo for RFC.


Signed-off-by: John Bradley 
---
 hw/gpio/bcm2835_gpio.c | 136 +++--
 include/hw/gpio/bcm2835_gpio.h |   4 +
 include/qemu/PanelEmu.h|  53 +++
 util/Makefile.objs |   1 +
 util/PanelEmu.c| 326 +
 5 files changed, 479 insertions(+), 41 deletions(-)
 create mode 100644 include/qemu/PanelEmu.h
 create mode 100644 util/PanelEmu.c

diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c
index acc2e3cf9e..5df3f4cddf 100644
--- a/hw/gpio/bcm2835_gpio.c
+++ b/hw/gpio/bcm2835_gpio.c
@@ -19,6 +19,8 @@
 #include "hw/sd/sd.h"
 #include "hw/gpio/bcm2835_gpio.h"
 
+
+
 #define GPFSEL0   0x00
 #define GPFSEL1   0x04
 #define GPFSEL2   0x08
@@ -75,24 +77,24 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, 
uint32_t value)
 
 /* SD controller selection (48-53) */
 if (s->sd_fsel != 0
-&& (s->fsel[48] == 0) /* SD_CLK_R */
-&& (s->fsel[49] == 0) /* SD_CMD_R */
-&& (s->fsel[50] == 0) /* SD_DATA0_R */
-&& (s->fsel[51] == 0) /* SD_DATA1_R */
-&& (s->fsel[52] == 0) /* SD_DATA2_R */
-&& (s->fsel[53] == 0) /* SD_DATA3_R */
-) {
+&& (s->fsel[48] == 0) /* SD_CLK_R */
+&& (s->fsel[49] == 0) /* SD_CMD_R */
+&& (s->fsel[50] == 0) /* SD_DATA0_R */
+&& (s->fsel[51] == 0) /* SD_DATA1_R */
+&& (s->fsel[52] == 0) /* SD_DATA2_R */
+&& (s->fsel[53] == 0) /* SD_DATA3_R */
+) {
 /* SDHCI controller selected */
 sdbus_reparent_card(s->sdbus_sdhost, s->sdbus_sdhci);
 s->sd_fsel = 0;
 } else if (s->sd_fsel != 4
-&& (s->fsel[48] == 4) /* SD_CLK_R */
-&& (s->fsel[49] == 4) /* SD_CMD_R */
-&& (s->fsel[50] == 4) /* SD_DATA0_R */
-&& (s->fsel[51] == 4) /* SD_DATA1_R */
-&& (s->fsel[52] == 4) /* SD_DATA2_R */
-&& (s->fsel[53] == 4) /* SD_DATA3_R */
-) {
+   && (s->fsel[48] == 4) /* SD_CLK_R */
+   && (s->fsel[49] == 4) /* SD_CMD_R */
+   && (s->fsel[50] == 4) /* SD_DATA0_R */
+   && (s->fsel[51] == 4) /* SD_DATA1_R */
+   && (s->fsel[52] == 4) /* SD_DATA2_R */
+   && (s->fsel[53] == 4) /* SD_DATA3_R */
+   ) {
 /* SDHost controller selected */
 sdbus_reparent_card(s->sdbus_sdhci, s->sdbus_sdhost);
 s->sd_fsel = 4;
@@ -108,7 +110,7 @@ static int gpfsel_is_out(BCM2835GpioState *s, int index)
 }
 
 static void gpset(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
 uint32_t changes = val & ~*lev;
 uint32_t cur = 1;
@@ -125,7 +127,7 @@ static void gpset(BCM2835GpioState *s,
 }
 
 static void gpclr(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
 uint32_t changes = val & *lev;
 uint32_t cur = 1;
@@ -141,11 +143,12 @@ static void gpclr(BCM2835GpioState *s,
 *lev &= ~val;
 }
 
-static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset,
-unsigned size)
+static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset, unsigned size)
 {
 BCM2835GpioState *s = (BCM2835GpioState *)opaque;
 
+uint64_t Data;
+
 switch (offset) {
 case GPFSEL0:
 case GPFSEL1:
@@ -163,8 +166,20 @@ static uint64_t bcm2835_gpio_read(void *opaque, hwaddr 
offset,
 /* Write Only */
 return 0;
 case GPLEV0:
+if (s->panel.socket != -1) {
+if (panel_read(>panel, )) {
+s->lev0 = (uint32_t)Data;
+s->lev1 = (uint32_t)(Data >> 32);
+}
+}
 return s->lev0;
 case GPLEV1:
+if (s->panel.socket != -1) {
+if (panel_read(>panel, )) {
+s->lev0 = (uint32_t)Data;
+s->lev1 = (uint32_t)(Data >> 32);
+}
+}
 return s->lev1;
 case GPEDS0:
 case GPEDS1:
@@ -187,7 +202,7 @@ static uint64_t bcm2835_gpio_read(void *opaque, hwaddr 
offset,
 return 0;
 default:
 qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %"HWADDR_PRIx"\n",
-__func__, offset);
+  __func__, offset);
 break;
 }
 

[Qemu-devel] [PATCH V2] Add code to connect to external panel, for ARM

2017-05-22 Thread John Bradley via Qemu-devel
>From 5f5c186162ef5f56872095318106e9fe360ae310 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Tue, 23 May 2017 01:43:32 +0100
Subject: [PATCH] Add code to connect to external panel, for ARM

Has no effect if panel not found.

GDummyPanel Fix formating issues.

Add inital discussion of protocol version.

Add code to connect with https://github.com/flypie/GDummyPanel The code uses 
GNU Sockets & Windows
sockets as on MINGW GNU no available. This is inteded as a Demo for RFC.


Signed-off-by: John Bradley 
---
 hw/gpio/bcm2835_gpio.c | 136 +++--
 include/hw/gpio/bcm2835_gpio.h |   4 +
 include/qemu/PanelEmu.h|  53 +++
 util/Makefile.objs |   1 +
 util/PanelEmu.c| 326 +
 5 files changed, 479 insertions(+), 41 deletions(-)
 create mode 100644 include/qemu/PanelEmu.h
 create mode 100644 util/PanelEmu.c

diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c
index acc2e3cf9e..5df3f4cddf 100644
--- a/hw/gpio/bcm2835_gpio.c
+++ b/hw/gpio/bcm2835_gpio.c
@@ -19,6 +19,8 @@
 #include "hw/sd/sd.h"
 #include "hw/gpio/bcm2835_gpio.h"
 
+
+
 #define GPFSEL0   0x00
 #define GPFSEL1   0x04
 #define GPFSEL2   0x08
@@ -75,24 +77,24 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, 
uint32_t value)
 
 /* SD controller selection (48-53) */
 if (s->sd_fsel != 0
-&& (s->fsel[48] == 0) /* SD_CLK_R */
-&& (s->fsel[49] == 0) /* SD_CMD_R */
-&& (s->fsel[50] == 0) /* SD_DATA0_R */
-&& (s->fsel[51] == 0) /* SD_DATA1_R */
-&& (s->fsel[52] == 0) /* SD_DATA2_R */
-&& (s->fsel[53] == 0) /* SD_DATA3_R */
-) {
+&& (s->fsel[48] == 0) /* SD_CLK_R */
+&& (s->fsel[49] == 0) /* SD_CMD_R */
+&& (s->fsel[50] == 0) /* SD_DATA0_R */
+&& (s->fsel[51] == 0) /* SD_DATA1_R */
+&& (s->fsel[52] == 0) /* SD_DATA2_R */
+&& (s->fsel[53] == 0) /* SD_DATA3_R */
+) {
 /* SDHCI controller selected */
 sdbus_reparent_card(s->sdbus_sdhost, s->sdbus_sdhci);
 s->sd_fsel = 0;
 } else if (s->sd_fsel != 4
-&& (s->fsel[48] == 4) /* SD_CLK_R */
-&& (s->fsel[49] == 4) /* SD_CMD_R */
-&& (s->fsel[50] == 4) /* SD_DATA0_R */
-&& (s->fsel[51] == 4) /* SD_DATA1_R */
-&& (s->fsel[52] == 4) /* SD_DATA2_R */
-&& (s->fsel[53] == 4) /* SD_DATA3_R */
-) {
+   && (s->fsel[48] == 4) /* SD_CLK_R */
+   && (s->fsel[49] == 4) /* SD_CMD_R */
+   && (s->fsel[50] == 4) /* SD_DATA0_R */
+   && (s->fsel[51] == 4) /* SD_DATA1_R */
+   && (s->fsel[52] == 4) /* SD_DATA2_R */
+   && (s->fsel[53] == 4) /* SD_DATA3_R */
+   ) {
 /* SDHost controller selected */
 sdbus_reparent_card(s->sdbus_sdhci, s->sdbus_sdhost);
 s->sd_fsel = 4;
@@ -108,7 +110,7 @@ static int gpfsel_is_out(BCM2835GpioState *s, int index)
 }
 
 static void gpset(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
 uint32_t changes = val & ~*lev;
 uint32_t cur = 1;
@@ -125,7 +127,7 @@ static void gpset(BCM2835GpioState *s,
 }
 
 static void gpclr(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
 uint32_t changes = val & *lev;
 uint32_t cur = 1;
@@ -141,11 +143,12 @@ static void gpclr(BCM2835GpioState *s,
 *lev &= ~val;
 }
 
-static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset,
-unsigned size)
+static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset, unsigned size)
 {
 BCM2835GpioState *s = (BCM2835GpioState *)opaque;
 
+uint64_t Data;
+
 switch (offset) {
 case GPFSEL0:
 case GPFSEL1:
@@ -163,8 +166,20 @@ static uint64_t bcm2835_gpio_read(void *opaque, hwaddr 
offset,
 /* Write Only */
 return 0;
 case GPLEV0:
+if (s->panel.socket != -1) {
+if (panel_read(>panel, )) {
+s->lev0 = (uint32_t)Data;
+s->lev1 = (uint32_t)(Data >> 32);
+}
+}
 return s->lev0;
 case GPLEV1:
+if (s->panel.socket != -1) {
+if (panel_read(>panel, )) {
+s->lev0 = (uint32_t)Data;
+s->lev1 = (uint32_t)(Data >> 32);
+}
+}
 return s->lev1;
 case GPEDS0:
 case GPEDS1:
@@ -187,7 +202,7 @@ static uint64_t bcm2835_gpio_read(void *opaque, hwaddr 
offset,
 return 0;
 default:
 qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %"HWADDR_PRIx"\n",
-__func__, offset);
+  __func__, offset);
 break;
 }
 

[Qemu-devel] [PATCH] Add code to connect to external panel, for ARM

2017-05-22 Thread John Bradley via Qemu-devel
>From 9256c1450557ed67b4328761ab80b4e80be26e3e Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Tue, 23 May 2017 01:43:32 +0100
Subject: [PATCH] Add code to connect to external panel, for ARM

Has no effect if panel not found.

GDummyPanel Fix formating issues.

Add inital discussion of protocol version.

Add code to connect with https://github.com/flypie/GDummyPanel The code uses 
GNU Sockets & Windows
sockets as on MINGW GNU no available. This is inteded as a Demo for RFC.


Signed-off-by: John Bradley 
---
 hw/arm/Makefile.objs   |   2 +-
 hw/arm/bcm2835_peripherals.c   | 104 +
 hw/gpio/bcm2835_gpio.c | 136 +++--
 include/hw/gpio/bcm2835_gpio.h |   4 +
 include/qemu/PanelEmu.h|  53 +++
 util/PanelEmu.c| 326 +
 6 files changed, 583 insertions(+), 42 deletions(-)
 create mode 100644 include/qemu/PanelEmu.h
 create mode 100644 util/PanelEmu.c

diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 4c5c4ee76c..35b2da24f5 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -11,7 +11,7 @@ obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o 
pxa2xx_pic.o
 obj-$(CONFIG_DIGIC) += digic.o
 obj-y += omap1.o omap2.o strongarm.o
 obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
-obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
+obj-$(CONFIG_RASPI) += bcm2835.o bcm2835_peripherals.o bcm2836.o raspi.o
 obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
 obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o
 obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 369ef1e3bd..0ca05ca685 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -56,6 +56,29 @@ static void bcm2835_peripherals_init(Object *obj)
 object_property_add_child(obj, "aux", OBJECT(>aux), NULL);
 qdev_set_parent_bus(DEVICE(>aux), sysbus_get_default());
 
+/* System timer */
+object_initialize(>st, sizeof(s->st), TYPE_BCM2835_ST);
+object_property_add_child(obj, "systimer", OBJECT(>st), NULL);
+qdev_set_parent_bus(DEVICE(>st), sysbus_get_default());
+
+/* ARM timer */
+object_initialize(>timer, sizeof(s->timer), TYPE_BCM2835_TIMER);
+object_property_add_child(obj, "armtimer", OBJECT(>timer), NULL);
+qdev_set_parent_bus(DEVICE(>timer), sysbus_get_default());
+
+/* USB controller */
+object_initialize(>usb, sizeof(s->usb), TYPE_BCM2835_USB);
+object_property_add_child(obj, "usb", OBJECT(>usb), NULL);
+qdev_set_parent_bus(DEVICE(>usb), sysbus_get_default());
+
+object_property_add_const_link(OBJECT(>usb), "dma_mr",
+   OBJECT(>gpu_bus_mr), _abort);
+
+/* MPHI - Message-based Parallel Host Interface */
+object_initialize(>mphi, sizeof(s->mphi), TYPE_BCM2835_MPHI);
+object_property_add_child(obj, "mphi", OBJECT(>mphi), NULL);
+qdev_set_parent_bus(DEVICE(>mphi), sysbus_get_default());
+
 /* Mailboxes */
 object_initialize(>mboxes, sizeof(s->mboxes), TYPE_BCM2835_MBOX);
 object_property_add_child(obj, "mbox", OBJECT(>mboxes), NULL);
@@ -64,6 +87,11 @@ static void bcm2835_peripherals_init(Object *obj)
 object_property_add_const_link(OBJECT(>mboxes), "mbox-mr",
OBJECT(>mbox_mr), _abort);
 
+/* Power management */
+object_initialize(>power, sizeof(s->power), TYPE_BCM2835_POWER);
+object_property_add_child(obj, "power", OBJECT(>power), NULL);
+qdev_set_parent_bus(DEVICE(>power), sysbus_get_default());
+
 /* Framebuffer */
 object_initialize(>fb, sizeof(s->fb), TYPE_BCM2835_FB);
 object_property_add_child(obj, "fb", OBJECT(>fb), NULL);
@@ -179,6 +207,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, 
Error **errp)
 sysbus_connect_irq(s->uart0, 0,
 qdev_get_gpio_in_named(DEVICE(>ic), BCM2835_IC_GPU_IRQ,
INTERRUPT_UART));
+
 /* AUX / UART1 */
 qdev_prop_set_chr(DEVICE(>aux), "chardev", serial_hds[1]);
 
@@ -194,6 +223,67 @@ static void bcm2835_peripherals_realize(DeviceState *dev, 
Error **errp)
 qdev_get_gpio_in_named(DEVICE(>ic), BCM2835_IC_GPU_IRQ,
INTERRUPT_AUX));
 
+/* System timer */
+object_property_set_bool(OBJECT(>st), true, "realized", );
+if (err) {
+error_propagate(errp, err);
+return;
+}
+
+memory_region_add_subregion(>peri_mr, ST_OFFSET,
+sysbus_mmio_get_region(SYS_BUS_DEVICE(>st), 0));
+sysbus_connect_irq(SYS_BUS_DEVICE(>st), 0,
+qdev_get_gpio_in_named(DEVICE(>ic), BCM2835_IC_GPU_IRQ,
+   INTERRUPT_TIMER0));
+sysbus_connect_irq(SYS_BUS_DEVICE(>st), 1,
+qdev_get_gpio_in_named(DEVICE(>ic), BCM2835_IC_GPU_IRQ,
+   INTERRUPT_TIMER1));
+

[Qemu-devel] [PATCH] [PATCH V2] GDummyPanel Fix formatingissues.

2017-05-22 Thread John Bradley via Qemu-devel
>From 468b7c74d36b1e9d56ca014531301f0485254866 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Fri, 19 May 2017 00:01:07 +0100
Subject: [PATCH] [PATCH V2] GDummyPanel Fix formatingissues.

Add inital discussion of protocol version.

Add code to connect with https://github.com/flypie/GDummyPanel The code uses 
GNU Sockets & Windows
sockets as on MINGW GNU no available. This is inteded as a Demo for RFC.

Signed-off-by: John Bradley 
---
 hw/gpio/bcm2835_gpio.c | 316 ++-
 include/hw/gpio/bcm2835_gpio.h |   4 +
 include/qemu/PanelEmu.h|  53 +++
 util/Makefile.objs |   1 +
 util/PanelEmu.c| 327 +
 5 files changed, 570 insertions(+), 131 deletions(-)
 create mode 100644 include/qemu/PanelEmu.h
 create mode 100644 util/PanelEmu.c

diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c
index acc2e3cf9e..2c9026c597 100644
--- a/hw/gpio/bcm2835_gpio.c
+++ b/hw/gpio/bcm2835_gpio.c
@@ -19,6 +19,8 @@
 #include "hw/sd/sd.h"
 #include "hw/gpio/bcm2835_gpio.h"
 
+
+
 #define GPFSEL0   0x00
 #define GPFSEL1   0x04
 #define GPFSEL2   0x08
@@ -55,7 +57,7 @@ static uint32_t gpfsel_get(BCM2835GpioState *s, uint8_t reg)
 uint32_t value = 0;
 for (i = 0; i < 10; i++) {
 uint32_t index = 10 * reg + i;
-if (index < sizeof(s->fsel)) {
+if (index < sizeof (s->fsel)) {
 value |= (s->fsel[index] & 0x7) << (3 * i);
 }
 }
@@ -67,7 +69,7 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, 
uint32_t value)
 int i;
 for (i = 0; i < 10; i++) {
 uint32_t index = 10 * reg + i;
-if (index < sizeof(s->fsel)) {
+if (index < sizeof (s->fsel)) {
 int fsel = (value >> (3 * i)) & 0x7;
 s->fsel[index] = fsel;
 }
@@ -75,24 +77,24 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, 
uint32_t value)
 
 /* SD controller selection (48-53) */
 if (s->sd_fsel != 0
-&& (s->fsel[48] == 0) /* SD_CLK_R */
-&& (s->fsel[49] == 0) /* SD_CMD_R */
-&& (s->fsel[50] == 0) /* SD_DATA0_R */
-&& (s->fsel[51] == 0) /* SD_DATA1_R */
-&& (s->fsel[52] == 0) /* SD_DATA2_R */
-&& (s->fsel[53] == 0) /* SD_DATA3_R */
-) {
+&& (s->fsel[48] == 0) /* SD_CLK_R */
+&& (s->fsel[49] == 0) /* SD_CMD_R */
+&& (s->fsel[50] == 0) /* SD_DATA0_R */
+&& (s->fsel[51] == 0) /* SD_DATA1_R */
+&& (s->fsel[52] == 0) /* SD_DATA2_R */
+&& (s->fsel[53] == 0) /* SD_DATA3_R */
+) {
 /* SDHCI controller selected */
 sdbus_reparent_card(s->sdbus_sdhost, s->sdbus_sdhci);
 s->sd_fsel = 0;
 } else if (s->sd_fsel != 4
-&& (s->fsel[48] == 4) /* SD_CLK_R */
-&& (s->fsel[49] == 4) /* SD_CMD_R */
-&& (s->fsel[50] == 4) /* SD_DATA0_R */
-&& (s->fsel[51] == 4) /* SD_DATA1_R */
-&& (s->fsel[52] == 4) /* SD_DATA2_R */
-&& (s->fsel[53] == 4) /* SD_DATA3_R */
-) {
+   && (s->fsel[48] == 4) /* SD_CLK_R */
+   && (s->fsel[49] == 4) /* SD_CMD_R */
+   && (s->fsel[50] == 4) /* SD_DATA0_R */
+   && (s->fsel[51] == 4) /* SD_DATA1_R */
+   && (s->fsel[52] == 4) /* SD_DATA2_R */
+   && (s->fsel[53] == 4) /* SD_DATA3_R */
+   ) {
 /* SDHost controller selected */
 sdbus_reparent_card(s->sdbus_sdhci, s->sdbus_sdhost);
 s->sd_fsel = 4;
@@ -108,9 +110,9 @@ static int gpfsel_is_out(BCM2835GpioState *s, int index)
 }
 
 static void gpset(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
-uint32_t changes = val & ~*lev;
+uint32_t changes = val & ~ *lev;
 uint32_t cur = 1;
 
 int i;
@@ -125,7 +127,7 @@ static void gpset(BCM2835GpioState *s,
 }
 
 static void gpclr(BCM2835GpioState *s,
-uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
+  uint32_t val, uint8_t start, uint8_t count, uint32_t *lev)
 {
 uint32_t changes = val & *lev;
 uint32_t cur = 1;
@@ -141,116 +143,153 @@ static void gpclr(BCM2835GpioState *s,
 *lev &= ~val;
 }
 
-static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset,
-unsigned size)
+static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset, unsigned size)
 {
 BCM2835GpioState *s = (BCM2835GpioState *)opaque;
 
+uint64_t Data;
+
 switch (offset) {
-case GPFSEL0:
-case GPFSEL1:
-case GPFSEL2:
-case GPFSEL3:
-case GPFSEL4:
-case GPFSEL5:
-return gpfsel_get(s, offset / 4);
-case GPSET0:
-case GPSET1:
-/* Write Only */
-return 0;
-case GPCLR0:
-case GPCLR1:
-/* Write 

Re: [Qemu-devel] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

2017-05-18 Thread John Bradley via Qemu-devel
HI,
No worries about Yesterday.
I decided to take a different approach. I'll put that stuff in that relates to 
GDummyPanel flypie/GDummyPanel first I sent the patch to the list a copy is 
here. 0001-PATCH-V-2-GDummyPanel-Fix-formatingissues.patch

  
|  
|   
|   
|   ||

   |

  |
|  
||  
0001-PATCH-V-2-GDummyPanel-Fix-formatingissues.patch
 Shared with Dropbox  |   |

  |

  |

 


Then set about getting the upgrades from Andrew Baumann in.
Then prepare an RFC for the  protocol used by GDummyPanel taking into account 
any feed pack on the prototype/proof of concept/risk reduction in the patch.

  
|  
|   
|   
|   ||

   |

  |
|  
||  
flypie/GDummyPanel
 GDummyPanel - The Client App which links to the Raspi to help simulate GPIO  | 
  |

  |

  |

 
 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Thursday, 18 May 2017, 8:47, Markus Armbruster  wrote:
 

 IANAL, this wouldn't be legal advice even if I was one, yadda, yadda,
here goes anyway:

Eric Blake  writes:

> On 05/17/2017 04:25 PM, John Bradley wrote:
>> Well unfortunately Eric. I don't understand your "top posted" slang.
>
> To learn what top-posting is:
> http://lmgtfy.com/?q=what+is+top-posting
>
> and why we don't like it on technical lists:
> http://www.caliburn.nl/topposting.html
>
> Or more humorously:

Seconded.

> A: Yes.
>> >Q: Are you sure?
>>> >>A: Because it reverses the logical flow of conversation.
 >>>Q: Why is top posting frowned upon?
>
>> 
>> As for his "intent", it is quite irrelevant as I have gone over the code 
>> line by line and what every he intended to do, he has succeed, as far as I 
>> can tell , in matching you standards, to such an extent that I am happy that 
>
> You are correct that the GPL gives us legal rights to use Andrew's code
> without his permission.  And yes, YOU can fork qemu, and take whatever
> GPL patches you want without attribution, and you are probably still
> just fine legally (as long as you still abide by the GPL in that you
> distribute sources to anyone that has your binary).
>
> But our project rules do not allow us to live by just GPL (in part,
> because the license of qemu is sometimes tricky to determine due to a
> mix of GPLv2-only code and non-GPL code, even though most new code is
> GPLv2+).  Also, if we ever had a reason to change license (supposing it
> is even possible, although it might require ripping out or
> reimplementing portions of the code base), having S-o-b means that we
> cannot be accused of applying a license that someone did not agree to.
>
> Therefore, it is easier, pragmatically, even if not legally necessary,
> to enforce proper chain of authorship by getting Signed-off-by: tags on
> ALL patches, especially where a patch asserts a copyright owner, insofar
> as the original copyright owner is still alive and able to assent to the
> action.  It is not just about legalities, it is also about risk-avoidance.
>
> It may sound like we are being hard-nosed (and so be it), but there's a
> reason that we list proper Signed-off-by: rules as our number 1 item on
> the SubmitAPatch page.
> http://wiki.qemu.org/Contribute/SubmitAPatch

Yes, we require patch submitters to provide their Signed-off-by.

We encourage documenting a patch's provenance in full by having every
author provide their S-o-b, whenever practical.  But we don't require
it.

The core purpose of the S-o-b is "to improve tracking of who did what"
by making patch authors formally certify that they "wrote it or
otherwise have the right to pass it on as a open-source patch"[2].  Note
"improve" and "have the right to pass it on".

One of the (many) reasons we're making software free is to help our
neighbor[1] by letting him use our creation on a quid pro quo basis.
Always requiring all author's S-o-b could make incorporating otherwise
free code impractical, and thus would conflict with this mission.

When obtaining an S-o-b is impractical, documenting provenance in other
ways has to do.

John wrote upthread:

    Andrew Baumann has and others have release the code under GNU
    General Public License version 2 (GPLv2), the same as QEMU that
    allows me to added it to QEMU as it is under the same license, by
    signing it off this is what I am certifying.

I agree with the reasoning "if free software compatible with the GPLv2,
then I can incorporate it into QEMU as long as I certify by signing
off".

John, thank you for your contribution to QEMU.  I'm sorry your patch got
side-tracked into this non-technical swamp, and hope you understand why
we're rather careful when it comes to protecting the freedom of our
software.  I futher hope that we can put than behind us (along with
top-posting *grin*), and move on to the fun part.


[1] See "The four essential freedoms"
https://www.gnu.org/philosophy/free-sw.en.html
[2] 

Re: [Qemu-devel] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

2017-05-17 Thread John Bradley via Qemu-devel
Well unfortunately Eric. I don't understand your "top posted" slang.

As for his "intent", it is quite irrelevant as I have gone over the code line 
by line and what every he intended to do, he has succeed, as far as I can tell 
, in matching you standards, to such an extent that I am happy that 


 
John Bradley
Tel: 07896 839635
Skype: flypie125
125B Grove Street
Edge Hill 
Liverpool L7 7AF


On Wednesday, 17 May 2017, 22:15, Eric Blake  wrote:



On 05/17/2017 03:53 PM, John Bradley wrote:
> Andrew Baumann has and others have release the code under GNU General Public 
> License version 2 (GPLv2), the same as QEMU that allows me to added it to 
> QEMU as it is under the same license, by signing it off this is what I am 
> certifying. 

See this document linked from the SubmitAPatch link (it describes the
kernel meaning of S-o-b tags, although the qemu meaning is the same):

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297

Yes, your Signed-off-by: asserts that you are okay releasing your
portions of the patch (bullets a, d) and that you chased down that
portions that you did not write are properly licensed (bullet b), but
what you are missing is that when you modify someone else's patch, we
also need that someone's assertion of intent that their work (whether or
not modified by you) meets the same standards (bullet c).  In other
words, when modifying a patch, S-o-b lines should be additive in nature,
rather than replacing his by yours (or, if his is missing in the source
you originally copied from, then we really need to Andrew to chime in
and add one); this is so that there is a full chain of custody on who
wrote portions of the commit.


>  John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
> Liverpool L7 7AF 

Your mailer is sending very poor formatting when rendered as plain text
(and we frown on html mail on this list).

> 
> On Wednesday, 17 May 2017, 20:11, Eric Blake  wrote:
>  
> 
>  On 05/17/2017 01:34 PM, John Bradley wrote:
>> This is especial true as I meant Andrew Baumann 0xabu (Andrew Baumann)
> 
> Top-posting is not nice on technical lists.

And yet, in spite of me mentioning it, you still top-posted. :(


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



Well unfortunately Eric. I don't understand your "top posted" slang.

As for 
his "intent", it is quite irrelevant as I have gone over the code line 
by line and what every he intended to do, he has succeed, as far as I 
can tell , in matching you standards, to such an extent that I am happy 
that he has succeeded in reaching your standards and am happy to certify that 
he has.

As for my mailer it is Yahoos and again as far as I can tell it is full RFC822 
compliant, so perhaps you should adjust you obviously defective mail reader.



[Qemu-devel] [PATCH] Add BCM2835 devices to Arm hardware.

2017-05-17 Thread John Bradley via Qemu-devel
>From 0b39a04030d5a2cea4fcd2159d365580ca155b78 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Wed, 17 May 2017 18:57:21 +0100
Subject: [PATCH] Add BCM2835 devices to Arm hardware.

Signed-off-by: John Bradley 
---
hw/arm/bcm2835.c | 114 +++
1 file changed, 114 insertions(+)

diff --git a/hw/arm/bcm2835.c b/hw/arm/bcm2835.c
new file mode 100644
index 00..e5744c1620
--- /dev/null
+++ b/hw/arm/bcm2835.c
@@ -0,0 +1,114 @@
+/*
+ * Raspberry Pi emulation (c) 2012 Gregory Estrade
+ * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
+ *
+ * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
+ * Written by Andrew Baumann
+ *
+ * This code is licensed under the GNU GPLv2 and later.
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "hw/arm/bcm2835.h"
+#include "hw/arm/raspi_platform.h"
+#include "hw/sysbus.h"
+#include "exec/address-spaces.h"
+
+
+/* Peripheral base address seen by the CPU */
+#define BCM2835_PERI_BASE   0x2000
+
+static void bcm2835_init(Object *obj)
+{
+BCM2835State *s = BCM2835(obj);
+
+object_initialize(>cpus[0], sizeof(s->cpus[0]), "arm1176-" 
TYPE_ARM_CPU);
+object_property_add_child(obj, "cpu", OBJECT(>cpus[0]), _abort);
+
+object_initialize(>peripherals, sizeof(s->peripherals),
+  TYPE_BCM2835_PERIPHERALS);
+object_property_add_child(obj, "peripherals", OBJECT(>peripherals),
+  _abort);
+object_property_add_alias(obj, "board-rev", OBJECT(>peripherals),
+  "board-rev", _abort);
+object_property_add_alias(obj, "vcram-size", OBJECT(>peripherals),
+  "vcram-size", _abort);
+qdev_set_parent_bus(DEVICE(>peripherals), sysbus_get_default());
+}
+
+static void bcm2835_realize(DeviceState *dev, Error **errp)
+{
+BCM2835State *s = BCM2835(dev);
+Object *obj;
+Error *err = NULL;
+
+/* common peripherals from bcm2835 */
+obj = object_property_get_link(OBJECT(dev), "ram", );
+if (obj == NULL) {
+error_setg(errp, "%s: required ram link not found: %s",
+   __func__, error_get_pretty(err));
+return;
+}
+
+object_property_add_const_link(OBJECT(>peripherals), "ram", obj, );
+if (err) {
+error_propagate(errp, err);
+return;
+}
+
+object_property_set_bool(OBJECT(>peripherals), true, "realized", );
+if (err) {
+error_propagate(errp, err);
+return;
+}
+
+object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(>peripherals),
+  "sd-bus", );
+if (err) {
+error_propagate(errp, err);
+return;
+}
+
+sysbus_mmio_map_overlap(SYS_BUS_DEVICE(>peripherals), 0,
+BCM2835_PERI_BASE, 1);
+
+object_property_set_bool(OBJECT(>cpus[0]), true, "realized", );
+if (err) {
+error_report_err(err);
+exit(1);
+}
+
+sysbus_connect_irq(SYS_BUS_DEVICE(>peripherals), 0,
+   qdev_get_gpio_in(DEVICE(>cpus[0]), ARM_CPU_IRQ));
+sysbus_connect_irq(SYS_BUS_DEVICE(>peripherals), 1,
+   qdev_get_gpio_in(DEVICE(>cpus[0]), ARM_CPU_FIQ));
+}
+
+static Property bcm2835_props[] = {
+DEFINE_PROP_UINT32("enabled-cpus", BCM2835State, enabled_cpus, 
BCM2835_NCPUS),
+DEFINE_PROP_END_OF_LIST()
+};
+
+static void bcm2835_class_init(ObjectClass *oc, void *data)
+{
+DeviceClass *dc = DEVICE_CLASS(oc);
+
+dc->props = bcm2835_props;
+dc->realize = bcm2835_realize;
+}
+
+static const TypeInfo bcm2835_type_info = {
+.name = TYPE_BCM2835,
+.parent = TYPE_SYS_BUS_DEVICE,
+.instance_size = sizeof(BCM2835State),
+.instance_init = bcm2835_init,
+.class_init = bcm2835_class_init,
+};
+
+static void bcm2835_register_types(void)
+{
+type_register_static(_type_info);
+}
+
+type_init(bcm2835_register_types)


 
John Bradley
Tel: 07896 839635
Skype: flypie125
125B Grove Street
Edge Hill 
Liverpool L7 7AF



Re: [Qemu-devel] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

2017-05-17 Thread John Bradley via Qemu-devel
Andrew Baumann has and others have release the code under GNU General Public 
License version 2 (GPLv2), the same as QEMU that allows me to added it to QEMU 
as it is under the same license, by signing it off this is what I am 
certifying. 
 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Wednesday, 17 May 2017, 20:11, Eric Blake  wrote:
 

 On 05/17/2017 01:34 PM, John Bradley wrote:
> This is especial true as I meant Andrew Baumann 0xabu (Andrew Baumann)

Top-posting is not nice on technical lists.

> 0xabu (Andrew Baumann)
>  0xabu has 3 repositories available. Follow their code on GitHub.  |  |

Using github requires the use of non-free (as in freedom) Javascript.
That's why this list prefers that all patches be sent through the list
as emails, not as github pull requests.  I'm not going to look at what
0xabu's repository contains, but rather at what you send through the
list. But part of the contract of Signed-off-by is that you have
permission to post the patch and agree to the license in use - which
means that if your work is a modified version of Andrew Baumann's work,
then you need Andrew Baumann's sign-off before you can add yours.

Other hints for better patch submission may be found here:
http://wiki.qemu.org/Contribute/SubmitAPatch

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.          +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


   


Re: [Qemu-devel] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

2017-05-17 Thread John Bradley via Qemu-devel
This is especial true as I meant Andrew Baumann 0xabu (Andrew Baumann)

  
|  
|   
|   
|   ||

   |

  |
|  
||  
0xabu (Andrew Baumann)
 0xabu has 3 repositories available. Follow their code on GitHub.  |   |

  |

  |

 

 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Wednesday, 17 May 2017, 19:27, Eric Blake <ebl...@redhat.com> wrote:
 

 On 05/17/2017 01:09 PM, John Bradley via Qemu-devel wrote:
> Also available at 
> 
> https://www.dropbox.com/s/gwuquw0kirstw7a/0001-Add-Markus-Armbrusters-code-for-Broadcom-Perhiperals.patch?dl=0

This content belongs...

> 
> Following suggestions split my original patch up. This the largest monolithic 
> chunk is 
> additional BCM device support from Markus Armbruster.
> 
> 
>>From 0b39a04030d5a2cea4fcd2159d365580ca155b78 Mon Sep 17 00:00:00 2001
> From: John Bradley <fly...@rocketmail.com>
> Date: Wed, 17 May 2017 18:57:21 +0100
> Subject: [PATCH] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.
> 
> Signed-off-by: John Bradley <fly...@rocketmail.com>

I would expect that if some of this code was written by Markus, then it
would carry his Signed-off-by.  Or, maybe you just mean that you are
splitting your patch according to the device Markus gave (in which case,
a Suggested-by: tag may be appropriate).  Either way, I don't see why
Markus' name has to be in the subject line (the patch subject should be
WHAT changed, not WHO suggested the change).

> ---

...here, after the --- separator.  It is useful to reviewers, but should
not end up as part of the actual commit message.

> hw/arm/Makefile.objs                |    2 +-
> hw/arm/bcm2835.c                    |  114 
> hw/arm/bcm2835_peripherals.c        |  104 
> hw/misc/Makefile.objs                |    2 +
> hw/misc/bcm2835_mphi.c              |  163 ++
> hw/misc/bcm2835_power.c              |  106 
> hw/timer/Makefile.objs              |    2 +
> hw/timer/bcm2835_st.c                |  202 +++
> hw/timer/bcm2835_timer.c            |  224 +++
> hw/usb/Makefile.objs                |    4 +-
> hw/usb/bcm2835_usb.c                |  604 +++
> hw/usb/bcm2835_usb_regs.h            | 1061 ++

That's still rather large to review in one chunk, especially while
touching other files.  It can probably still be split up further.

> include/hw/arm/bcm2835.h            |  37 ++
> include/hw/arm/bcm2835_peripherals.h |  10 +
> include/hw/intc/bcm2835_control.h    |  53 ++
> include/hw/misc/bcm2835_mphi.h      |  28 +
> include/hw/misc/bcm2835_power.h      |  22 +
> include/hw/timer/bcm2835_st.h        |  25 +
> include/hw/timer/bcm2835_timer.h    |  32 +
> include/hw/usb/bcm2835_usb.h        |  78 +++
> 20 files changed, 2871 insertions(+), 2 deletions(-)
> create mode 100644 hw/arm/bcm2835.c
> create mode 100644 hw/misc/bcm2835_mphi.c
> create mode 100644 hw/misc/bcm2835_power.c
> create mode 100644 hw/timer/bcm2835_st.c
> create mode 100644 hw/timer/bcm2835_timer.c
> create mode 100644 hw/usb/bcm2835_usb.c
> create mode 100644 hw/usb/bcm2835_usb_regs.h
> create mode 100644 include/hw/arm/bcm2835.h
> create mode 100644 include/hw/intc/bcm2835_control.h
> create mode 100644 include/hw/misc/bcm2835_mphi.h
> create mode 100644 include/hw/misc/bcm2835_power.h
> create mode 100644 include/hw/timer/bcm2835_st.h
> create mode 100644 include/hw/timer/bcm2835_timer.h
> create mode 100644 include/hw/usb/bcm2835_usb.h
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.          +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


   


[Qemu-devel] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

2017-05-17 Thread John Bradley via Qemu-devel
Also available at 

https://www.dropbox.com/s/gwuquw0kirstw7a/0001-Add-Markus-Armbrusters-code-for-Broadcom-Perhiperals.patch?dl=0

Following suggestions split my original patch up. This the largest monolithic 
chunk is 
additional BCM device support from Markus Armbruster.


>From 0b39a04030d5a2cea4fcd2159d365580ca155b78 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Wed, 17 May 2017 18:57:21 +0100
Subject: [PATCH] Add Markus Armbrusters code for Broadcom Perhiperals for ARM.

Signed-off-by: John Bradley 
---
hw/arm/Makefile.objs |2 +-
hw/arm/bcm2835.c |  114 
hw/arm/bcm2835_peripherals.c |  104 
hw/misc/Makefile.objs|2 +
hw/misc/bcm2835_mphi.c   |  163 ++
hw/misc/bcm2835_power.c  |  106 
hw/timer/Makefile.objs   |2 +
hw/timer/bcm2835_st.c|  202 +++
hw/timer/bcm2835_timer.c |  224 +++
hw/usb/Makefile.objs |4 +-
hw/usb/bcm2835_usb.c |  604 +++
hw/usb/bcm2835_usb_regs.h| 1061 ++
include/hw/arm/bcm2835.h |   37 ++
include/hw/arm/bcm2835_peripherals.h |   10 +
include/hw/intc/bcm2835_control.h|   53 ++
include/hw/misc/bcm2835_mphi.h   |   28 +
include/hw/misc/bcm2835_power.h  |   22 +
include/hw/timer/bcm2835_st.h|   25 +
include/hw/timer/bcm2835_timer.h |   32 +
include/hw/usb/bcm2835_usb.h |   78 +++
20 files changed, 2871 insertions(+), 2 deletions(-)
create mode 100644 hw/arm/bcm2835.c
create mode 100644 hw/misc/bcm2835_mphi.c
create mode 100644 hw/misc/bcm2835_power.c
create mode 100644 hw/timer/bcm2835_st.c
create mode 100644 hw/timer/bcm2835_timer.c
create mode 100644 hw/usb/bcm2835_usb.c
create mode 100644 hw/usb/bcm2835_usb_regs.h
create mode 100644 include/hw/arm/bcm2835.h
create mode 100644 include/hw/intc/bcm2835_control.h
create mode 100644 include/hw/misc/bcm2835_mphi.h
create mode 100644 include/hw/misc/bcm2835_power.h
create mode 100644 include/hw/timer/bcm2835_st.h
create mode 100644 include/hw/timer/bcm2835_timer.h
create mode 100644 include/hw/usb/bcm2835_usb.h

diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 4c5c4ee76c..35b2da24f5 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -11,7 +11,7 @@ obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o 
pxa2xx_pic.o
obj-$(CONFIG_DIGIC) += digic.o
obj-y += omap1.o omap2.o strongarm.o
obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
-obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
+obj-$(CONFIG_RASPI) += bcm2835.o bcm2835_peripherals.o bcm2836.o raspi.o
obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o
obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
diff --git a/hw/arm/bcm2835.c b/hw/arm/bcm2835.c
new file mode 100644
index 00..e5744c1620
--- /dev/null
+++ b/hw/arm/bcm2835.c
@@ -0,0 +1,114 @@
+/*
+ * Raspberry Pi emulation (c) 2012 Gregory Estrade
+ * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
+ *
+ * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
+ * Written by Andrew Baumann
+ *
+ * This code is licensed under the GNU GPLv2 and later.
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "hw/arm/bcm2835.h"
+#include "hw/arm/raspi_platform.h"
+#include "hw/sysbus.h"
+#include "exec/address-spaces.h"
+
+
+/* Peripheral base address seen by the CPU */
+#define BCM2835_PERI_BASE   0x2000
+
+static void bcm2835_init(Object *obj)
+{
+BCM2835State *s = BCM2835(obj);
+
+object_initialize(>cpus[0], sizeof(s->cpus[0]), "arm1176-" 
TYPE_ARM_CPU);
+object_property_add_child(obj, "cpu", OBJECT(>cpus[0]), _abort);
+
+object_initialize(>peripherals, sizeof(s->peripherals),
+  TYPE_BCM2835_PERIPHERALS);
+object_property_add_child(obj, "peripherals", OBJECT(>peripherals),
+  _abort);
+object_property_add_alias(obj, "board-rev", OBJECT(>peripherals),
+  "board-rev", _abort);
+object_property_add_alias(obj, "vcram-size", OBJECT(>peripherals),
+  "vcram-size", _abort);
+qdev_set_parent_bus(DEVICE(>peripherals), sysbus_get_default());
+}
+
+static void bcm2835_realize(DeviceState *dev, Error **errp)
+{
+BCM2835State *s = BCM2835(dev);
+Object *obj;
+Error *err = NULL;
+
+/* common peripherals from bcm2835 */
+obj = object_property_get_link(OBJECT(dev), "ram", );
+if (obj == NULL) {
+error_setg(errp, "%s: required ram link not found: %s",
+   __func__, error_get_pretty(err));
+return;
+}
+
+object_property_add_const_link(OBJECT(>peripherals), "ram", obj, );
+if (err) {
+error_propagate(errp, err);
+return;
+}
+
+

Re: [Qemu-devel] [Qemu-arm] Changes to Broadcom(BCM) files and Raspberry Pi files. Addition of PanelEmu

2017-05-16 Thread John Bradley via Qemu-devel
The idea of an RFC is good, but with it I would like to have a demo. Something 
with no mass implementation to worry about and this would be it. 
I should also add a version number to the initialisation of the protocol to 
increase robustness, between versions. I'll call this one V 0.
 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Tuesday, 16 May 2017, 9:56, Geert Martin Ijewski <gm.ijew...@web.de> 
wrote:
 

 Am 16.05.2017 um 02:01 schrieb John Bradley via Qemu-devel:
> Hi,
> The XML files in the base are not in the patch. They where net beans files. I 
> can easily get it into 3 files, one large at 91KB but contains only new files 
> and so is easy to read. Could be smaller but seems pointless.
>
I think what Alistar meant was something along the lines of:
patch/commit 1) add the remaining bcm2835 devices from Markus 
Armbruster's code to QEMU (btw: any reason why that hasn't been done? 
The USB stuff does seem nice to have)
-- with a more meaningful commit title
2) add utils/panelemu.c and the include
3) bcm2835 now uses the emupanel
and then your other commits e.g.
4) USB CDC Ethernet driver dropped packets
5) emupanel: fixed compilation errors on linux
6) emupanel: removed last blocking I/O

Along the way you also seem to fix indentation in other code a lot, that 
makes following the patches more confusing than they need to be.
It's harder to gauge at a quick glance whether you changed something 
meaingul or not.

Maybe even send a RFC just detailing the protocol, because it's probably 
important to get that right from the start.

Geert
> another which is about 19KB of quite simple changes to mostly make files.
> Then one 15KB which quite straight forward when you look at it. Applying them 
> in that order should allow step wise addition. I've uploaded them to a share 
> if anyone wants to comment.
>
> The 3 files are new.patch
>
> |
> |
> |
> |  |    |
>
>    |
>
>  |
> |
> |    |
> new.patch
>  Shared with Dropbox  |  |
>
>  |
>
>  |
>
>
>  mod1.patch
>
>
> |
> |
> |
> |  |    |
>
>    |
>
>  |
> |
> |    |
> mod1.patch
>  Shared with Dropbox  |  |
>
>  |
>
>  |
>
>
>
> and
>  a_hw_gpio_bcm2835_gpio.c.patch
>
> |
> |
> |
> |  |    |
>
>    |
>
>  |
> |
> |    |
> a_hw_gpio_bcm2835_gpio.c.patch
>  Shared with Dropbox  |  |
>
>  |
>
>  |
>
>
>
>
>
> John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
> Liverpool L7 7AF
>
>    On Tuesday, 16 May 2017, 0:20, Philippe Mathieu-Daudé <f4...@amsat.org> 
>wrote:
>
>
>  Hi John,
>
>> That is going to be very difficult as a lot of the changes are
>> interlinked the vast majority of the patch is new files.
>
> I rebased your branch on latest qemu/master here:
>
> https://github.com/philmd/qemu/tree/flypie-GDummyPanel-rebased
>
> It is much easier to follow now, the big XML files you added/removed
> also disappeared (gitk was crashing 'Out Of Memory' trying to look at
> your tree).
>
> I hope it can help you to continue reordering in smaller patches.
>
> Regards,
>
> Phil.
>
> On 05/15/2017 01:46 PM, Alistair Francis wrote:
>>
>> Hey John,
>>
>> Thanks for the patch!
>>
>> Unfortunately this patch is too long to review, you need to split the
>> patch up into shorter more readable patches. Otherwise it's too hard
>> to people to understand what you are changing and why.
>>
>> There are some details here:
>> http://wiki.qemu.org/Contribute/SubmitAPatch
>> <http://wiki.qemu.org/Contribute/SubmitAPatch>about how to split up
>> patches. Each patch applied in order shouldn't break any compilation
>> or runtime. Generally the flow is to add the logic in earlier patches
>> and then connect it and switch it on in the later patches.
>>
>> Try splitting up adding/editing each individual device and send that
>> our first. That is generally the easiest to review/accept.
>>
>> Thanks,
>>
>> Alistair
>>
>>> ---
>>> .gitignore                          |  54 ++
>>> hw/arm/Makefile.objs                |    2 +-
>>> hw/arm/bcm2835.c                    |  114 
>>> hw/arm/bcm2835_peripherals.c        |  104 
>>> hw/arm/bcm2836.c                    |    3 +-
>>> hw/arm/raspi.c                      |  77 ++-
>>> hw/gpio/bcm2835_gpio.c              |  333 ++-
>>> hw/misc/Makefile.objs                |    2 +
>>> hw/misc/bcm2835_mphi.c              |  163 ++
>>> hw/misc/bcm2835_power.c              |  106 
>>&

Re: [Qemu-devel] Changes to Broadcom(BCM) files and Raspberry Pi files. Addition of PanelEmu

2017-05-16 Thread John Bradley via Qemu-devel
"I think that should be #ifdef _WIN32.
Maybe in the far future QEMU could also be compiled with Visual Studio 
or any other windows compiler"
The reason for doing it this way is that MINGW64, which is the dev platform I 
uses on Windows10, does not include a port of the GNU Socket library so I have 
to use the native Win Sock Library.
 
"Why not something like
typedef struct
{
    uint8_t len;
    uint8_t type;
    union {
        struct {
            uint8_t cnt;
        } pinCount;
        struct {
            uint16_t pin0to15;
            uint16_t pin16to31;
            uint16_t pin32to47;
            uint16_t pin48to63;
        } dataUpdate;
        /* todo: other packet types */
    };
} CommandPacket;"

The problem with that is packing. I tried to do it that way but the different 
compilers I am using for QEMU and GDummyPanel pack and align in different way 
and no collection of pragmas and directives could make them pack the same. 
While writing this I have also noticed I have made an implicit assumption about 
the endedness of the data, which is not good. Also keep in mind someone may 
write a client in any language from Fortran, Forth to Python.

"what's the use of this pointer aritmethic instead of just 6?"

This is a similar attempt at robustness across compilers.

John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Tuesday, 16 May 2017, 9:56, Geert Martin Ijewski <gm.ijew...@web.de> 
wrote:
 

 Am 14.05.2017 um 02:42 schrieb John Bradley via Qemu-devel:
>>From 7f74f048f135d9c9c230a9e90f72451c841c6d35 Mon Sep 17 00:00:00 2001
> From: John Bradley <fly...@rocketmail.com>
> Date: Sat, 13 May 2017 23:07:47 +0100
> Subject: [PATCH] Changes to Broadcom(BCM) files and Raspberry Pi files.
> Addition of PanelEmu
>
> The files add the ability to attach, via TCP, a panel emulator
> The include a unification of several PD Raspberry PI additions
> A modification to dev-network to all circle SDK WWW client to work
> The DummyPanel is not included but available at
> https://github.com/flypie/GDummyPanel.git
>
> Signed-off-by: John Bradley <fly...@rocketmail.com>
> ---
> [ ... snip ... ]
> diff --git a/util/PanelEmu.c b/util/PanelEmu.c
> new file mode 100644
> index 00..59c87d2747
> --- /dev/null
> +++ b/util/PanelEmu.c
> @@ -0,0 +1,293 @@
> +/*
> + * Emulation for Rasp PI GPIO via Server connected to via Socket
> + *
> + */
> +#include "qemu/osdep.h"
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#ifdef __MINGW32__
I think that should be #ifdef _WIN32.
Maybe in the far future QEMU could also be compiled with Visual Studio 
or any other windows compiler
> +#include 
> +#else
> +#include 
> +#include 
> +#include 
> +#endif
> +
> +
> +#include "qemu/PanelEmu.h"
> +
> +typedef enum
> +{
> +    MACHINEDESC = 0,
> +    PINSTOPANEL = 1,
> +    READREQ = 2,
> +    PINCOUNT = 3,
> +    ENABLEMAP = 4,
> +    INPUTMAP = 5,
> +    OUTPUTMAP = 6,
> +    PINSTOQEMU = 7
> +} PacketType;
> +
> +#define MAXPACKET  255
> +
> +#define PACKETLEN  0  //Includes Packet Length
> +#define PACKETTYPE  1
> +
> +typedef struct
> +{
> +    unsigned short int Data[MAXPACKET];
> +} CommandPacket;

Why not something like
typedef struct
{
    uint8_t len;
    uint8_t type;
    union {
        struct {
            uint8_t cnt;
        } pinCount;
        struct {
            uint16_t pin0to15;
            uint16_t pin16to31;
            uint16_t pin32to47;
            uint16_t pin48to63;
        } dataUpdate;
        /* todo: other packet types */
    };
} CommandPacket;
> [ ... snip ... ]
> +/* Set a pin to a specified value */
> +void senddatatopanel(panel_connection_t* h, uint64_t pin, bool val)
> +{
> +    CommandPacket Pkt;
> +
> +    Pkt.Data[PACKETLEN] = (char *) [6 + 1]-(char *) [0];
what's the use of this pointer aritmethic instead of just 6?

Geert



   


Re: [Qemu-devel] [Qemu-arm] Changes to Broadcom(BCM) files and Raspberry Pi files. Addition of PanelEmu

2017-05-15 Thread John Bradley via Qemu-devel
Hi,
The XML files in the base are not in the patch. They where net beans files. I 
can easily get it into 3 files, one large at 91KB but contains only new files 
and so is easy to read. Could be smaller but seems pointless. 

another which is about 19KB of quite simple changes to mostly make files.
Then one 15KB which quite straight forward when you look at it. Applying them 
in that order should allow step wise addition. I've uploaded them to a share if 
anyone wants to comment.

The 3 files are new.patch
  
|  
|   
|   
|   ||

   |

  |
|  
||  
new.patch
 Shared with Dropbox  |   |

  |

  |

 
 mod1.patch

  
|  
|   
|   
|   ||

   |

  |
|  
||  
mod1.patch
 Shared with Dropbox  |   |

  |

  |

 

and 
 a_hw_gpio_bcm2835_gpio.c.patch
  
|  
|   
|   
|   ||

   |

  |
|  
||  
a_hw_gpio_bcm2835_gpio.c.patch
 Shared with Dropbox  |   |

  |

  |

 



John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Tuesday, 16 May 2017, 0:20, Philippe Mathieu-Daudé  
wrote:
 

 Hi John,

> That is going to be very difficult as a lot of the changes are
> interlinked the vast majority of the patch is new files.

I rebased your branch on latest qemu/master here:

https://github.com/philmd/qemu/tree/flypie-GDummyPanel-rebased

It is much easier to follow now, the big XML files you added/removed 
also disappeared (gitk was crashing 'Out Of Memory' trying to look at 
your tree).

I hope it can help you to continue reordering in smaller patches.

Regards,

Phil.

On 05/15/2017 01:46 PM, Alistair Francis wrote:
>
> Hey John,
>
> Thanks for the patch!
>
> Unfortunately this patch is too long to review, you need to split the
> patch up into shorter more readable patches. Otherwise it's too hard
> to people to understand what you are changing and why.
>
> There are some details here:
> http://wiki.qemu.org/Contribute/SubmitAPatch
> about how to split up
> patches. Each patch applied in order shouldn't break any compilation
> or runtime. Generally the flow is to add the logic in earlier patches
> and then connect it and switch it on in the later patches.
>
> Try splitting up adding/editing each individual device and send that
> our first. That is generally the easiest to review/accept.
>
> Thanks,
>
> Alistair
>
>> ---
>> .gitignore                          |  54 ++
>> hw/arm/Makefile.objs                |    2 +-
>> hw/arm/bcm2835.c                    |  114 
>> hw/arm/bcm2835_peripherals.c        |  104 
>> hw/arm/bcm2836.c                    |    3 +-
>> hw/arm/raspi.c                      |  77 ++-
>> hw/gpio/bcm2835_gpio.c              |  333 ++-
>> hw/misc/Makefile.objs                |    2 +
>> hw/misc/bcm2835_mphi.c              |  163 ++
>> hw/misc/bcm2835_power.c              |  106 
>> hw/timer/Makefile.objs              |    2 +
>> hw/timer/bcm2835_st.c                |  202 +++
>> hw/timer/bcm2835_timer.c            |  224 +++
>> hw/usb/Makefile.objs                |    4 +-
>> hw/usb/bcm2835_usb.c                |  604 +++
>> hw/usb/bcm2835_usb_regs.h            | 1061
> ++
>> hw/usb/dev-network.c                |    2 +-
>> include/hw/arm/bcm2835.h            |  37 ++
>> include/hw/arm/bcm2835_peripherals.h |  10 +
>> include/hw/gpio/bcm2835_gpio.h      |    5 +
>> include/hw/intc/bcm2835_control.h    |  53 ++
>> include/hw/intc/bcm2836_control.h    |    2 +
>> include/hw/misc/bcm2835_mphi.h      |  28 +
>> include/hw/misc/bcm2835_power.h      |  22 +
>> include/hw/timer/bcm2835_st.h        |  25 +
>> include/hw/timer/bcm2835_timer.h    |  32 +
>> include/hw/usb/bcm2835_usb.h        |  78 +++
>> include/qemu/PanelEmu.h              |  53 ++
>> util/Makefile.objs                  |    1 +
>> util/PanelEmu.c                      |  293 ++
>> 30 files changed, 3547 insertions(+), 149 deletions(-)
>> create mode 100644 hw/arm/bcm2835.c
>> create mode 100644 hw/misc/bcm2835_mphi.c
>> create mode 100644 hw/misc/bcm2835_power.c
>> create mode 100644 hw/timer/bcm2835_st.c
>> create mode 100644 hw/timer/bcm2835_timer.c
>> create mode 100644 hw/usb/bcm2835_usb.c
>> create mode 100644 hw/usb/bcm2835_usb_regs.h
>> create mode 100644 include/hw/arm/bcm2835.h
>> create mode 100644 include/hw/intc/bcm2835_control.h
>> create mode 100644 include/hw/misc/bcm2835_mphi.h
>> create mode 100644 include/hw/misc/bcm2835_power.h
>> create mode 100644 include/hw/timer/bcm2835_st.h
>> create mode 100644 include/hw/timer/bcm2835_timer.h
>> create mode 100644 include/hw/usb/bcm2835_usb.h
>> create mode 100644 include/qemu/PanelEmu.h
>> create mode 100644 util/PanelEmu.c
>>
>
>


   


Re: [Qemu-devel] Changes to Broadcom(BCM) files and Raspberry Pi files. Addition of PanelEmu

2017-05-15 Thread John Bradley via Qemu-devel
Hi,
That is going to be very difficult as a lot of the changes are interlinked the 
vast majority of the patch is new files. John BradleyTel: 07896 839635Skype: 
flypie125 125B Grove StreetEdge Hill Liverpool L7 7AF 

On Monday, 15 May 2017, 17:54, Alistair Francis 
<alistair.fran...@xilinx.com> wrote:
 

 On Sat, May 13, 2017 at 5:42 PM, John Bradley via Qemu-devel
<qemu-devel@nongnu.org> wrote:
> From 7f74f048f135d9c9c230a9e90f72451c841c6d35 Mon Sep 17 00:00:00 2001
> From: John Bradley <fly...@rocketmail.com>
> Date: Sat, 13 May 2017 23:07:47 +0100
> Subject: [PATCH] Changes to Broadcom(BCM) files and Raspberry Pi files.
> Addition of PanelEmu
>
> The files add the ability to attach, via TCP, a panel emulator
> The include a unification of several PD Raspberry PI additions
> A modification to dev-network to all circle SDK WWW client to work
> The DummyPanel is not included but available at
> https://github.com/flypie/GDummyPanel.git
>
> Signed-off-by: John Bradley <fly...@rocketmail.com>

Hey John,

Thanks for the patch!

Unfortunately this patch is too long to review, you need to split the
patch up into shorter more readable patches. Otherwise it's too hard
to people to understand what you are changing and why.

There are some details here:
http://wiki.qemu.org/Contribute/SubmitAPatch about how to split up
patches. Each patch applied in order shouldn't break any compilation
or runtime. Generally the flow is to add the logic in earlier patches
and then connect it and switch it on in the later patches.

Try splitting up adding/editing each individual device and send that
our first. That is generally the easiest to review/accept.

Thanks,

Alistair

> ---
> .gitignore                          |  54 ++
> hw/arm/Makefile.objs                |    2 +-
> hw/arm/bcm2835.c                    |  114 
> hw/arm/bcm2835_peripherals.c        |  104 
> hw/arm/bcm2836.c                    |    3 +-
> hw/arm/raspi.c                      |  77 ++-
> hw/gpio/bcm2835_gpio.c              |  333 ++-
> hw/misc/Makefile.objs                |    2 +
> hw/misc/bcm2835_mphi.c              |  163 ++
> hw/misc/bcm2835_power.c              |  106 
> hw/timer/Makefile.objs              |    2 +
> hw/timer/bcm2835_st.c                |  202 +++
> hw/timer/bcm2835_timer.c            |  224 +++
> hw/usb/Makefile.objs                |    4 +-
> hw/usb/bcm2835_usb.c                |  604 +++
> hw/usb/bcm2835_usb_regs.h            | 1061 ++
> hw/usb/dev-network.c                |    2 +-
> include/hw/arm/bcm2835.h            |  37 ++
> include/hw/arm/bcm2835_peripherals.h |  10 +
> include/hw/gpio/bcm2835_gpio.h      |    5 +
> include/hw/intc/bcm2835_control.h    |  53 ++
> include/hw/intc/bcm2836_control.h    |    2 +
> include/hw/misc/bcm2835_mphi.h      |  28 +
> include/hw/misc/bcm2835_power.h      |  22 +
> include/hw/timer/bcm2835_st.h        |  25 +
> include/hw/timer/bcm2835_timer.h    |  32 +
> include/hw/usb/bcm2835_usb.h        |  78 +++
> include/qemu/PanelEmu.h              |  53 ++
> util/Makefile.objs                  |    1 +
> util/PanelEmu.c                      |  293 ++
> 30 files changed, 3547 insertions(+), 149 deletions(-)
> create mode 100644 hw/arm/bcm2835.c
> create mode 100644 hw/misc/bcm2835_mphi.c
> create mode 100644 hw/misc/bcm2835_power.c
> create mode 100644 hw/timer/bcm2835_st.c
> create mode 100644 hw/timer/bcm2835_timer.c
> create mode 100644 hw/usb/bcm2835_usb.c
> create mode 100644 hw/usb/bcm2835_usb_regs.h
> create mode 100644 include/hw/arm/bcm2835.h
> create mode 100644 include/hw/intc/bcm2835_control.h
> create mode 100644 include/hw/misc/bcm2835_mphi.h
> create mode 100644 include/hw/misc/bcm2835_power.h
> create mode 100644 include/hw/timer/bcm2835_st.h
> create mode 100644 include/hw/timer/bcm2835_timer.h
> create mode 100644 include/hw/usb/bcm2835_usb.h
> create mode 100644 include/qemu/PanelEmu.h
> create mode 100644 util/PanelEmu.c
>


   


[Qemu-devel] Changes to Broadcom(BCM) files and Raspberry Pi files. Addition of PanelEmu

2017-05-13 Thread John Bradley via Qemu-devel
>From 7f74f048f135d9c9c230a9e90f72451c841c6d35 Mon Sep 17 00:00:00 2001
From: John Bradley 
Date: Sat, 13 May 2017 23:07:47 +0100
Subject: [PATCH] Changes to Broadcom(BCM) files and Raspberry Pi files.
Addition of PanelEmu

The files add the ability to attach, via TCP, a panel emulator
The include a unification of several PD Raspberry PI additions
A modification to dev-network to all circle SDK WWW client to work
The DummyPanel is not included but available at
https://github.com/flypie/GDummyPanel.git

Signed-off-by: John Bradley 
---
.gitignore   |   54 ++
hw/arm/Makefile.objs |2 +-
hw/arm/bcm2835.c |  114 
hw/arm/bcm2835_peripherals.c |  104 
hw/arm/bcm2836.c |3 +-
hw/arm/raspi.c   |   77 ++-
hw/gpio/bcm2835_gpio.c   |  333 ++-
hw/misc/Makefile.objs|2 +
hw/misc/bcm2835_mphi.c   |  163 ++
hw/misc/bcm2835_power.c  |  106 
hw/timer/Makefile.objs   |2 +
hw/timer/bcm2835_st.c|  202 +++
hw/timer/bcm2835_timer.c |  224 +++
hw/usb/Makefile.objs |4 +-
hw/usb/bcm2835_usb.c |  604 +++
hw/usb/bcm2835_usb_regs.h| 1061 ++
hw/usb/dev-network.c |2 +-
include/hw/arm/bcm2835.h |   37 ++
include/hw/arm/bcm2835_peripherals.h |   10 +
include/hw/gpio/bcm2835_gpio.h   |5 +
include/hw/intc/bcm2835_control.h|   53 ++
include/hw/intc/bcm2836_control.h|2 +
include/hw/misc/bcm2835_mphi.h   |   28 +
include/hw/misc/bcm2835_power.h  |   22 +
include/hw/timer/bcm2835_st.h|   25 +
include/hw/timer/bcm2835_timer.h |   32 +
include/hw/usb/bcm2835_usb.h |   78 +++
include/qemu/PanelEmu.h  |   53 ++
util/Makefile.objs   |1 +
util/PanelEmu.c  |  293 ++
30 files changed, 3547 insertions(+), 149 deletions(-)
create mode 100644 hw/arm/bcm2835.c
create mode 100644 hw/misc/bcm2835_mphi.c
create mode 100644 hw/misc/bcm2835_power.c
create mode 100644 hw/timer/bcm2835_st.c
create mode 100644 hw/timer/bcm2835_timer.c
create mode 100644 hw/usb/bcm2835_usb.c
create mode 100644 hw/usb/bcm2835_usb_regs.h
create mode 100644 include/hw/arm/bcm2835.h
create mode 100644 include/hw/intc/bcm2835_control.h
create mode 100644 include/hw/misc/bcm2835_mphi.h
create mode 100644 include/hw/misc/bcm2835_power.h
create mode 100644 include/hw/timer/bcm2835_st.h
create mode 100644 include/hw/timer/bcm2835_timer.h
create mode 100644 include/hw/usb/bcm2835_usb.h
create mode 100644 include/qemu/PanelEmu.h
create mode 100644 util/PanelEmu.c

diff --git a/.gitignore b/.gitignore
index 55a001e3b8..08e0ac978f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/bin
/config-devices.*
/config-all-devices.*
/config-all-disas.*
@@ -131,3 +132,56 @@ trace-dtrace-root.h
trace-dtrace-root.dtrace
trace-ust-all.h
trace-ust-all.c
+
+bin/debug/x86_64-w64-mingw64/Makefile
+
+bin/debug/x86_64-w64-mingw64/arm-softmmu/Makefile
+
+bin/debug/x86_64-w64-mingw64/arm-softmmu/config-devices.mak
+
+# Compiled source #
+###
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+##
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+##
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+.cproject
+.project
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+.nb-gradle/
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 4c5c4ee76c..35b2da24f5 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -11,7 +11,7 @@ obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o 
pxa2xx_pic.o
obj-$(CONFIG_DIGIC) += digic.o
obj-y += omap1.o omap2.o strongarm.o
obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
-obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
+obj-$(CONFIG_RASPI) += bcm2835.o bcm2835_peripherals.o bcm2836.o raspi.o
obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o
obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
diff --git a/hw/arm/bcm2835.c b/hw/arm/bcm2835.c
new file mode 100644
index 00..e5744c1620
--- /dev/null
+++ b/hw/arm/bcm2835.c
@@ -0,0 +1,114 @@
+/*
+ * Raspberry Pi emulation (c) 2012 Gregory Estrade
+ * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
+ *
+ * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
+ * Written by Andrew Baumann
+ *
+ * This code is licensed under the GNU GPLv2 and later.
+ */
+

[Qemu-devel] Error Msg on list.

2017-05-13 Thread John Bradley via Qemu-devel
Is this just me. I got the following message from 2 different SMTP servers. 
Google & Yahoo when sending via GIT mail. Mail to myself worked.

Your message wasn't delivered to qemu-devel@nongnu.org because the address 
couldn't be found. Check for typos or unnecessary spaces and try again. John 
BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill Liverpool 
L7 7AF


Re: [Qemu-devel] Dummy Panel.

2017-05-05 Thread John Bradley via Qemu-devel
The underlying protocol is flexible enough, though only binary at the moment. I 
could image a situation were a device driver communicated with the emulation 
using it or alternately an application communicated with some hardware and 
passed it on to the emulator. As the protocol is quite simple and open it could 
easily be adapted, the GDummyPanel could be viewed as a separate project just 
one of many potential clients.
Code would have to be added to each different emulation as the specifics of the 
IO of each vary.
Here is a video of the latest version running on windows.demo may 4

  
|  
|   
|   
|   ||

   |

  |
|  
||  
demo may 4
 QEMU Emulating a Raspberry PI 2 running the QEMU IO demo from Circle low level 
system. Using GDummyPanel to inte...  |   |

  |

  |

 
 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF 

On Friday, 5 May 2017, 16:07, Stefan Hajnoczi <stefa...@gmail.com> wrote:
 

 On Wed, May 03, 2017 at 02:20:55PM +, John Bradley via Qemu-devel wrote:
> Hi
> I have created a new fork on GitHub https://github.com/flypie/flypie-pi-qemu 
> and an associated project https://github.com/flypie/GDummyPanel the idea as 
> well as getting the Original PI emulation working is to add some facility for 
> simulated IO. This is a demonstration of the latest version, running the QEMU 
> demo from https://github.com/rsta2/circle. I took the idea from an 
> implementation for the BIFFboard but only the socket number is left, the 
> commuications is all via IP. The code is only really Alpha level at the 
> moment and needs some refing to reduce bandwidth. I could also extend the 
> code so that the connection can be to a remote machine rather than via the 
> local host.
> 
> I intend to generalise the code, to work with several different boards other 
> than the PI, could anyone suggest a board that would benefit from such an add 
> on.
> Is this a worth while addon? 
> John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
> Liverpool L7 7AF

CCing ARM maintainers (see the ./MAINTAINERS file to find the right
people to CC)

Stefan

   


[Qemu-devel] Dummy Panel.

2017-05-03 Thread John Bradley via Qemu-devel
Hi
I have created a new fork on GitHub https://github.com/flypie/flypie-pi-qemu 
and an associated project https://github.com/flypie/GDummyPanel the idea as 
well as getting the Original PI emulation working is to add some facility for 
simulated IO. This is a demonstration of the latest version, running the QEMU 
demo from https://github.com/rsta2/circle. I took the idea from an 
implementation for the BIFFboard but only the socket number is left, the 
commuications is all via IP. The code is only really Alpha level at the moment 
and needs some refing to reduce bandwidth. I could also extend the code so that 
the connection can be to a remote machine rather than via the local host.

I intend to generalise the code, to work with several different boards other 
than the PI, could anyone suggest a board that would benefit from such an add 
on.
Is this a worth while addon? 
John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF


[Qemu-devel] Fw: Raspberry PI

2017-04-05 Thread John Bradley via Qemu-devel
 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF

 On Wednesday, 5 April 2017, 23:20, John Snow <js...@redhat.com> wrote:
 

 

On 04/03/2017 02:17 PM, John Bradley wrote:
> Hi,
> 
> Not sure what I am doing at the moment.
> 
> It is very little of my code, there are various Rasp version out of
> there, most of which are old forks that do not run on windows.
> I created this be merging in several sources to get one that worked, the
> current plan is to keep it up to date with the current master release,
> if I can work out how.
> 
> The link is flypie/qemu <https://github.com/flypie/qemu.git>
> 

Share with the list, not just me!

--js

>     
> 
>     
> 
> 
>    flypie/qemu
> 
> Official QEMU mirror. Please see
> http://wiki.qemu.org/Contribute/SubmitAPatch for how to submit changes
> to QEMU
>     
> 
> <https://github.com/flypie/qemu.git>
> 
> 
>  
> John Bradley
> Tel: 07896 839635
> Skype: flypie125
> 125B Grove Street
> Edge Hill
> Liverpool L7 7AF
> 
> 
> On Monday, 3 April 2017, 19:12, John Snow <js...@redhat.com> wrote:
> 
> 
> 
> 
> On 04/02/2017 03:59 PM, John Bradley via Qemu-devel wrote:
>> Hi,
>> I've just pulled together a collection of patches from various sources
> to get the Raspberry PI emulation working on the March 27 source. Is it
> worth sending it in as a patch for inclusion. It allows some of the
> Circle low level demo to run.
>>
>>
>>  John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge
> Hill Liverpool L7 7AF
> 
>>
> 
> If you are willing to commit to the review process of upstreaming this
> code and creating revisions and so on, please do send patches!
> 
> If you're feeling like you're already done with the project, it may
> still be useful to get a link to a git tree so others can at least see
> the code, but without a steward they'll almost certainly not get merged.
> 
> --js


   


[Qemu-devel] Raspberry PI

2017-04-03 Thread John Bradley via Qemu-devel
Hi,
I've just pulled together a collection of patches from various sources to get 
the Raspberry PI emulation working on the March 27 source. Is it worth sending 
it in as a patch for inclusion. It allows some of the Circle low level demo to 
run.


 John BradleyTel: 07896 839635Skype: flypie125 125B Grove StreetEdge Hill 
Liverpool L7 7AF