Skip to contentSkip to conversation

ARM: Samsung S5PC210-based boards support.

PATCH Superseded Evgeny Voevodin 4 participants 25 messages Dec 7, 2011 – Dec 9, 2011 Kbuild

v1 of 16 Superseded Latest is v16 →

lore
Share & tools
lore
#0 lore raw

cover ARM: Samsung S5PC210-based boards support.

This set of patches adds support for Samsung S5PC210-based boards NURI and SMDKC210. Tested on Linux kernel v3.x series. Usage of "-smp 2" option is reuired for now.

Evgeny Voevodin (10):
hw/sysbus.h: Increase maximum number of device IRQs.
ARM: s5pc210: IRQ subsystem support.
ARM: s5pc210: PWM support.
hw/arm_boot.c: Add new secondary CPU bootloader. hw/arm_gic.c: lower IRQ only on changing of enable bit.
ARM: s5pc210: MCT support.
ARM: s5pc210: Boot secondary CPU. hw/lan9118.c: Basic byte/word/long access support. hw/s5pc210.c: Add lan9118 support to SMDK board.
s5pc210: Switch to sysbus_init_mmio.

Maksim Kozlov (1):
ARM: s5pc210: Basic support of s5pc210 boards

Mitsyanko Igor (3):
ARM: s5pc210: added s5pc210 display controller device (FIMD) SD card: add query function to check wether SD card currently ready
to recieve data Before executing data transfer to card, we must
check that previously issued command wasn't a simple query command (for ex. CMD13), which doesn't require data transfer. Currently, we only can aquire information about whether SD card is in sending data state or not. This patch allows us to query wether previous command was data write command and it was successfully accepted by card (meaning that SD card in recieving data state).
ARM: s5pc210: added SD/MMC host controller (ver. 2.0 compliant)
implementation

 Makefile.target       |    3 +
 hw/arm-misc.h         |    1 +
 hw/arm_boot.c         |   22 +-
 hw/arm_gic.c          |   20 +-
 hw/lan9118.c          |   96 +++-
 hw/s5pc210.c          |  550 ++++++++++++++++
 hw/s5pc210.h          |  105 +++
 hw/s5pc210_cmu.c      | 1144 +++++++++++++++++++++++++++++++++
 hw/s5pc210_combiner.c |  381 +++++++++++
 hw/s5pc210_fimd.c     | 1698 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/s5pc210_gic.c      |  411 ++++++++++++
 hw/s5pc210_mct.c      | 1483 ++++++++++++++++++++++++++++++++++++++++++
 hw/s5pc210_pwm.c      |  433 +++++++++++++
 hw/s5pc210_sdhc.c     | 1693 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/s5pc210_uart.c     |  677 ++++++++++++++++++++
 hw/sd.c               |    5 +
 hw/sd.h               |    1 +
 hw/sysbus.h           |    2 +-
 18 files changed, 8710 insertions(+), 15 deletions(-)
 create mode 100644 hw/s5pc210.c
 create mode 100644 hw/s5pc210.h
 create mode 100644 hw/s5pc210_cmu.c
 create mode 100644 hw/s5pc210_combiner.c
 create mode 100644 hw/s5pc210_fimd.c
 create mode 100644 hw/s5pc210_gic.c
 create mode 100644 hw/s5pc210_mct.c
 create mode 100644 hw/s5pc210_pwm.c
 create mode 100644 hw/s5pc210_sdhc.c
 create mode 100644 hw/s5pc210_uart.c
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/14 ARM: s5pc210: Basic support of s5pc210 boards

From: Maksim Kozlov <[email protected]>

Added support of S5PC210 based boards - SMDKC210 and NURI. CMU and UART basic implementation.

---
 Makefile.target   |    1 +
 hw/s5pc210.c      |  284 +++++++++++++
 hw/s5pc210.h      |   66 +++
 hw/s5pc210_cmu.c  | 1144 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/s5pc210_uart.c |  677 +++++++++++++++++++++++++++++++
 5 files changed, 2172 insertions(+), 0 deletions(-)
 create mode 100644 hw/s5pc210.c
 create mode 100644 hw/s5pc210.h
 create mode 100644 hw/s5pc210_cmu.c
 create mode 100644 hw/s5pc210_uart.c
Makefile.target +1 -0
index a111521..38fc364 100644
@@ -344,6 +344,7 @@ obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
+obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c new file +284 -0

284 lines not on this page · raw message

hw/s5pc210.h new file +66 -0

66 lines not on this page · raw message

hw/s5pc210_cmu.c new file +1144 -0

1,144 lines not on this page · raw message

hw/s5pc210_uart.c new file +677 -0

677 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#2 lore raw

Re: [Qemu-devel] [PATCH 01/14] ARM: s5pc210: Basic support of s5pc210 boards

If you split this patch up so it is:
1 cmu
2 uart
3 initial basic board

this will be easier to review than a 2000 line patch.

Quoted 30 lines
hw/s5pc210_uart.c new file +30 -0
+DeviceState *s5pc210_uart_create(target_phys_addr_t addr,
+                                 int fifo_size,
+                                 int channel,
+                                 CharDriverState *chr,
+                                 qemu_irq irq)
+{
+    DeviceState  *dev;
+    SysBusDevice *bus;
+    S5pc210UartState *state;
+
+    dev = qdev_create(NULL, "s5pc210.uart");
+
+    if (!chr) {
+        if (channel >= MAX_SERIAL_PORTS) {
+            hw_error("Only %d serial ports are supported by QEMU.\n",
+                     MAX_SERIAL_PORTS);
+        }
+        chr = serial_hds[channel];
+        if (!chr) {
+            chr = qemu_chr_new("s5pc210.uart", "null", NULL);
+            if (!(chr)) {
+                hw_error("Can't assign serial port to UART%d.\n", channel);
+            }
+        }
+    }
+
+    qdev_prop_set_chr(dev, "chardev", chr);
+    qdev_prop_set_uint32(dev, "channel", channel);
+
+    bus = sysbus_from_qdev(dev);

hw/s5pc210_uart.c line 635

Quoted 10 lines
hw/s5pc210_uart.c new file +10 -0
+    qdev_init_nofail(dev);
+    if (addr != (target_phys_addr_t)-1) {
+        sysbus_mmio_map(bus, 0, addr);
+    }
+    sysbus_connect_irq(bus, 0, irq);
+
+    state = FROM_SYSBUS(S5pc210UartState, bus);
+
+    state->rx.size = fifo_size;
+    state->tx.size = fifo_size;

This is wrong. Code at the "qdev_create(something)" level should not then reach in and mess with the underlying state structure of the device it's just created. fifo_size should probably be passed to the device as a qdev property.

Quoted 7 lines
hw/s5pc210_uart.c new file +7 -0
+static int s5pc210_uart_init(SysBusDevice *dev)
+{
+    S5pc210UartState *s = FROM_SYSBUS(S5pc210UartState, dev);
+
+    /* memory mapping */
+    memory_region_init_io(&s->iomem, &s5pc210_uart_ops, s, "s5pc210.uart",
+                          S5PC210_UART_REGS_MEM_SIZE);

hw/s5pc210_uart.c line 656

Quoted 10 lines
hw/s5pc210_uart.c new file +10 -0
+    sysbus_init_mmio_region(dev, &s->iomem);
+
+    sysbus_init_irq(dev, &s->irq);
+
+    qemu_chr_add_handlers(s->chr, s5pc210_uart_can_receive,
+                          s5pc210_uart_receive, s5pc210_uart_event, s);
+
+    vmstate_register(&dev->qdev, -1, &vmstate_s5pc210_uart, s);
+
+    qemu_register_reset(s5pc210_uart_reset, s);

You can set these up using .qdev.reset and .qdev.vmsd fields in your SysBusDeviceInfo struct, which is cleaner than calling functions to register them.

-- PMM

#3 lore raw

PATCH 2/14 hw/sysbus.h: Increase maximum number of device IRQs.

In reply to Evgeny Voevodin

Samsung s5pc210 Interrupt Combiner needs 512 IRQ sources.

---
 hw/sysbus.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/sysbus.h +1 -1
index 9bac582..4ef0c3c 100644
@@ -8,7 +8,7 @@
 
 #define QDEV_MAX_MMIO 32
 #define QDEV_MAX_PIO 32
-#define QDEV_MAX_IRQ 256
+#define QDEV_MAX_IRQ 512
 
 typedef struct SysBusDevice SysBusDevice;
 typedef void (*mmio_mapfunc)(SysBusDevice *dev, target_phys_addr_t addr);
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 3/14 ARM: s5pc210: IRQ subsystem support.

In reply to Evgeny Voevodin
---
 Makefile.target       |    3 +-
 hw/s5pc210.c          |  163 +++++++++++++++++++-
 hw/s5pc210.h          |   39 +++++
 hw/s5pc210_combiner.c |  381 +++++++++++++++++++++++++++++++++++++++++++++
 hw/s5pc210_gic.c      |  411 +++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 995 insertions(+), 2 deletions(-)
 create mode 100644 hw/s5pc210_combiner.c
 create mode 100644 hw/s5pc210_gic.c
Makefile.target +2 -1
index 38fc364..ed338a8 100644
@@ -344,7 +344,8 @@ obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
-obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o
+obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o s5pc210_gic.o \
+             s5pc210_combiner.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c +162 -1

207 lines not on this page · raw message

hw/s5pc210.h +39 -0
index bbf927c..412d004 100644
@@ -32,6 +32,45 @@
 #define S5PC210_MAX_CPUS             2
 
 /*
+ * s5pc210 IRQ subsystem stub definitions.
+ */
+
+#define S5PC210_MAX_INT_COMBINER_OUT_IRQ  64
+#define S5PC210_MAX_EXT_COMBINER_OUT_IRQ  16
+#define S5PC210_MAX_INT_COMBINER_IN_IRQ   (S5PC210_MAX_INT_COMBINER_OUT_IRQ * 8)
+#define S5PC210_MAX_EXT_COMBINER_IN_IRQ   (S5PC210_MAX_EXT_COMBINER_OUT_IRQ * 8)
+
+#define S5PC210_COMBINER_GET_IRQ_NUM(grp, bit)  ((grp)*8 + (bit))
+#define S5PC210_COMBINER_GET_GRP_NUM(irq)       ((irq) / 8)
+#define S5PC210_COMBINER_GET_BIT_NUM(irq) \
+    ((irq) - 8 * S5PC210_COMBINER_GET_GRP_NUM(irq))
+
+/* IRQs number for external and internal GIC */
+#define S5PC210_EXT_GIC_NIRQ                    (160-32)
+#define S5PC210_INT_GIC_NIRQ                    64
+
+typedef struct S5pc210Irq {
+    qemu_irq int_combiner_irq[S5PC210_MAX_INT_COMBINER_IN_IRQ];
+    qemu_irq ext_combiner_irq[S5PC210_MAX_EXT_COMBINER_IN_IRQ];
+    qemu_irq int_gic_irq[S5PC210_INT_GIC_NIRQ];
+    qemu_irq ext_gic_irq[S5PC210_EXT_GIC_NIRQ];
+    qemu_irq board_irqs[S5PC210_MAX_INT_COMBINER_IN_IRQ];
+} S5pc210Irq;
+
+/* Initialize s5pc210 IRQ subsystem stub */
+qemu_irq *s5pc210_init_irq(S5pc210Irq *env);
+
+/* Initialize board IRQs.
+ * These IRQs contain splitted Int/External Combiner and External Gic IRQs */
+void s5pc210_init_board_irqs(S5pc210Irq *s);
+
+/* Get IRQ number from s5pc210 IRQ subsystem stub.
+ * To identify IRQ source use internal combiner group and bit number
+ *  grp - group number
+ *  bit - bit number inside group */
+uint32_t s5pc210_get_irq(uint32_t grp, uint32_t bit);
+
+/*
  * Interface for s5pc210 Clock Management Units (CMUs)
  */
 
hw/s5pc210_combiner.c new file +381 -0

381 lines not on this page · raw message

hw/s5pc210_gic.c new file +411 -0

411 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 4/14 ARM: s5pc210: PWM support.

In reply to Evgeny Voevodin
---
 Makefile.target  |    2 +-
 hw/s5pc210.c     |   12 ++
 hw/s5pc210_pwm.c |  433 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 446 insertions(+), 1 deletions(-)
 create mode 100644 hw/s5pc210_pwm.c
Makefile.target +1 -1
index ed338a8..b9830d3 100644
@@ -345,7 +345,7 @@ obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o s5pc210_gic.o \
-             s5pc210_combiner.o
+             s5pc210_combiner.o s5pc210_pwm.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c +12 -0
index 99e9b1b..9110228 100644
@@ -89,6 +89,9 @@
 #define S5PC210_EXT_COMBINER_BASE_ADDR   0x10440000
 #define S5PC210_INT_COMBINER_BASE_ADDR   0x10448000
 
+/* PWM */
+#define S5PC210_PWM_BASE_ADDR            0x139D0000
+
 #define S5PC210_BASE_BOOT_ADDR           S5PC210_DRAM0_BASE_ADDR
 
 static struct arm_boot_info s5pc210_binfo = {
@@ -350,6 +353,15 @@ static void s5pc210_init(ram_addr_t ram_size,
     /* CMU */
     sysbus_create_simple("s5pc210.cmu", S5PC210_CMU_BASE_ADDR, NULL);
 
+    /* PWM */
+    sysbus_create_varargs("s5pc210.pwm", S5PC210_PWM_BASE_ADDR,
+            irq_table[s5pc210_get_irq(22, 0)],
+            irq_table[s5pc210_get_irq(22, 1)],
+            irq_table[s5pc210_get_irq(22, 2)],
+            irq_table[s5pc210_get_irq(22, 3)],
+            irq_table[s5pc210_get_irq(22, 4)],
+            NULL);
+
     /*** UARTs ***/
     for (n = 0; n < S5PC210_UARTS_NUMBER; n++) {
 
hw/s5pc210_pwm.c new file +433 -0

433 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 5/14 hw/arm_boot.c: Add new secondary CPU bootloader.

In reply to Evgeny Voevodin

Secondary CPU bootloader enables interrupt and issues wfi until start address is written to system controller. The position where to find this start address is hardcoded to 0x10000030. This commit adds new bootloader for secondary CPU which allows a target board to cpecify a position where to find start address. If target board doesn't specify start address then default 0x10000030 is used

---
 hw/arm-misc.h |    1 +
 hw/arm_boot.c |   22 +++++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)
hw/arm-misc.h +1 -0
index af403a1..6e8ae6b 100644
@@ -31,6 +31,7 @@ struct arm_boot_info {
     const char *initrd_filename;
     target_phys_addr_t loader_start;
     target_phys_addr_t smp_loader_start;
+    target_phys_addr_t smp_bootreg_addr;
     target_phys_addr_t smp_priv_base;
     int nb_cpus;
     int board_id;
hw/arm_boot.c +15 -7
index 215d5de..ecaac22 100644
@@ -31,17 +31,17 @@ static uint32_t bootloader[] = {
 /* Entry point for secondary CPUs.  Enable interrupt controller and
    Issue WFI until start address is written to system controller.  */
 static uint32_t smpboot[] = {
-  0xe59f0020, /* ldr     r0, privbase */
-  0xe3a01001, /* mov     r1, #1 */
-  0xe5801100, /* str     r1, [r0, #0x100] */
-  0xe3a00201, /* mov     r0, #0x10000000 */
-  0xe3800030, /* orr     r0, #0x30 */
+  0xe59f201c, /* ldr r2, privbase */
+  0xe59f001c, /* ldr r0, startaddr */
+  0xe3a01001, /* mov r1, #1 */
+  0xe5821100, /* str r1, [r2, #256] */
   0xe320f003, /* wfi */
   0xe5901000, /* ldr     r1, [r0] */
   0xe1110001, /* tst     r1, r1 */
   0x0afffffb, /* beq     <wfi> */
   0xe12fff11, /* bx      r1 */
-  0 /* privbase: Private memory region base address.  */
+  0,          /* privbase: Private memory region base address.  */
+  0           /* bootreg: Boot register address is hold here */
 };
 
 #define WRITE_WORD(p, value) do { \
@@ -179,6 +179,7 @@ static void do_cpu_reset(void *opaque)
 {
     CPUState *env = opaque;
     const struct arm_boot_info *info = env->boot_info;
+    uint8_t smp_bootreg_addr[4] = {0};
 
     cpu_reset(env);
     if (info) {
@@ -197,6 +198,8 @@ static void do_cpu_reset(void *opaque)
                                     info->loader_start);
                 }
             } else {
+                cpu_physical_memory_rw(info->smp_bootreg_addr, smp_bootreg_addr,
+                        sizeof(smp_bootreg_addr), 1);
                 env->regs[15] = info->smp_loader_start;
             }
         }
@@ -262,6 +265,7 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         } else {
             initrd_size = 0;
         }
+
         bootloader[1] |= info->board_id & 0xff;
         bootloader[2] |= (info->board_id >> 8) & 0xff;
         bootloader[5] = info->loader_start + KERNEL_ARGS_ADDR;
@@ -272,7 +276,11 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         rom_add_blob_fixed("bootloader", bootloader, sizeof(bootloader),
                            info->loader_start);
         if (info->nb_cpus > 1) {
-            smpboot[10] = info->smp_priv_base;
+            if (!info->smp_bootreg_addr) {
+                info->smp_bootreg_addr = 0x10000030;
+            }
+            smpboot[(sizeof(smpboot) - 8)/4] = info->smp_priv_base;
+            smpboot[(sizeof(smpboot) - 4)/4] = info->smp_bootreg_addr;
             for (n = 0; n < sizeof(smpboot) / 4; n++) {
                 smpboot[n] = tswap32(smpboot[n]);
             }
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH 6/14 hw/arm_gic.c: lower IRQ only on changing of enable bit.

In reply to Evgeny Voevodin

In previous version IRQ was lowered every time if enable bits were not set. If platform has splitted IRQ source to pass IRQ to two identical GICs simultaneously in first of which IRQ passing is enabled but in second is disabled, handling IRQ by second GIC would lower IRQ previously raised by first GIC.
Linux kernel v3.0 faces this problem.
The problem is avoided if IRQ is only lowered as result of transitioning enable bits to zeroes.

---
 hw/arm_gic.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
hw/arm_gic.c +19 -1
index 527c9ce..7e3db4f 100644
@@ -84,7 +84,9 @@ typedef struct gic_state
     SysBusDevice busdev;
     qemu_irq parent_irq[NCPU];
     int enabled;
+    int enabled_prev;
     int cpu_enabled[NCPU];
+    int cpu_enabled_prev[NCPU];
 
     gic_irq_state irq_state[GIC_NIRQ];
 #ifndef NVIC
@@ -116,12 +118,22 @@ static void gic_update(gic_state *s)
     int level;
     int cpu;
     int cm;
+    int enabled_prev;
+    int cpu_enabled_prev;
 
+    enabled_prev = s->enabled_prev;
+    s->enabled_prev = s->enabled;
     for (cpu = 0; cpu < NUM_CPU(s); cpu++) {
+        cpu_enabled_prev = s->cpu_enabled_prev[cpu];
+        s->cpu_enabled_prev[cpu] = s->cpu_enabled[cpu];
         cm = 1 << cpu;
         s->current_pending[cpu] = 1023;
         if (!s->enabled || !s->cpu_enabled[cpu]) {
-	    qemu_irq_lower(s->parent_irq[cpu]);
+            /* lower IRQ only if enable bit was changed */
+            if (enabled_prev != s->enabled
+                    || cpu_enabled_prev != s->cpu_enabled[cpu]) {
+                qemu_irq_lower(s->parent_irq[cpu]);
+            }
             return;
         }
         best_prio = 0x100;
@@ -650,6 +662,7 @@ static void gic_reset(gic_state *s)
 #else
         s->cpu_enabled[i] = 0;
 #endif
+        s->cpu_enabled_prev[i] = s->cpu_enabled[i];
     }
     for (i = 0; i < 16; i++) {
         GIC_SET_ENABLED(i, ALL_CPU_MASK);
@@ -661,6 +674,7 @@ static void gic_reset(gic_state *s)
 #else
     s->enabled = 0;
 #endif
+    s->enabled_prev = s->enabled;
 }
 
 static void gic_save(QEMUFile *f, void *opaque)
@@ -669,8 +683,10 @@ static void gic_save(QEMUFile *f, void *opaque)
     int i;
     int j;
 
+    qemu_put_be32(f, s->enabled_prev);
     qemu_put_be32(f, s->enabled);
     for (i = 0; i < NUM_CPU(s); i++) {
+        qemu_put_be32(f, s->cpu_enabled_prev[i]);
         qemu_put_be32(f, s->cpu_enabled[i]);
         for (j = 0; j < 32; j++)
             qemu_put_be32(f, s->priority1[j][i]);
@@ -706,8 +722,10 @@ static int gic_load(QEMUFile *f, void *opaque, int version_id)
     if (version_id != 2)
         return -EINVAL;
 
+    s->enabled_prev = qemu_get_be32(f);
     s->enabled = qemu_get_be32(f);
     for (i = 0; i < NUM_CPU(s); i++) {
+        s->cpu_enabled_prev[i] = qemu_get_be32(f);
         s->cpu_enabled[i] = qemu_get_be32(f);
         for (j = 0; j < 32; j++)
             s->priority1[j][i] = qemu_get_be32(f);
Signature · 1 line
1.7.4.1
#8 lore raw

PATCH 7/14 ARM: s5pc210: MCT support.

In reply to Evgeny Voevodin
---
 Makefile.target  |    2 +-
 hw/s5pc210.c     |   19 +
 hw/s5pc210_mct.c | 1483 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1503 insertions(+), 1 deletions(-)
 create mode 100644 hw/s5pc210_mct.c
Makefile.target +1 -1
index b9830d3..805993b 100644
@@ -345,7 +345,7 @@ obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o s5pc210_gic.o \
-             s5pc210_combiner.o s5pc210_pwm.o
+             s5pc210_combiner.o s5pc210_pwm.o s5pc210_mct.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c +19 -0
index 9110228..eabe3b1 100644
@@ -92,6 +92,9 @@
 /* PWM */
 #define S5PC210_PWM_BASE_ADDR            0x139D0000
 
+/* MCT */
+#define S5PC210_MCT_BASE_ADDR            0x10050000
+
 #define S5PC210_BASE_BOOT_ADDR           S5PC210_DRAM0_BASE_ADDR
 
 static struct arm_boot_info s5pc210_binfo = {
@@ -362,6 +365,22 @@ static void s5pc210_init(ram_addr_t ram_size,
             irq_table[s5pc210_get_irq(22, 4)],
             NULL);
 
+    /* Multi Core Timer */
+    dev = qdev_create(NULL, "s5pc210.mct");
+    qdev_init_nofail(dev);
+    busdev = sysbus_from_qdev(dev);
+    for (n = 0; n < 4; n++) {
+        /* Connect global timer interrupts to Combiner gpio_in */
+        sysbus_connect_irq(busdev, n,
+                irq_table[s5pc210_get_irq(1, 4 + n)]);
+    }
+    /* Connect local timer interrupts to Combiner gpio_in */
+    sysbus_connect_irq(busdev, 4,
+            irq_table[s5pc210_get_irq(51, 0)]);
+    sysbus_connect_irq(busdev, 5,
+            irq_table[s5pc210_get_irq(35, 3)]);
+    sysbus_mmio_map(busdev, 0, S5PC210_MCT_BASE_ADDR);
+
     /*** UARTs ***/
     for (n = 0; n < S5PC210_UARTS_NUMBER; n++) {
 
hw/s5pc210_mct.c new file +1483 -0

1,483 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#9 lore raw

PATCH 8/14 ARM: s5pc210: Boot secondary CPU.

In reply to Evgeny Voevodin
---
 hw/s5pc210.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
hw/s5pc210.c +25 -1
index eabe3b1..90858e9 100644
@@ -97,6 +97,12 @@
 
 #define S5PC210_BASE_BOOT_ADDR           S5PC210_DRAM0_BASE_ADDR
 
+/* Secondary CPU startup code is in IROM memory */
+#define S5PC210_SMP_BOOT_ADDR            S5PC210_IROM_BASE_ADDR
+
+/* Secondary CPU polling address to get loader start from */
+#define S5PC210_SECOND_CPU_BOOTREG       0x10020814
+
 static struct arm_boot_info s5pc210_binfo = {
         .loader_start     = S5PC210_BASE_BOOT_ADDR,
 };
@@ -213,6 +219,8 @@ static void s5pc210_init(ram_addr_t ram_size,
     MemoryRegion *irom_alias_mem = g_new(MemoryRegion, 1);
     MemoryRegion *dram0_mem = g_new(MemoryRegion, 1);
     MemoryRegion *dram1_mem = NULL;
+    MemoryRegion *hack_mem = g_new(MemoryRegion, 1);
+    MemoryRegion *bootreg_mem = g_new(MemoryRegion, 1);
     S5pc210Irq *irqs;
     qemu_irq *irq_table;
     qemu_irq *irqp;
@@ -225,9 +233,11 @@ static void s5pc210_init(ram_addr_t ram_size,
     switch (board_type) {
     case BOARD_S5PC210_NURI:
         s5pc210_binfo.board_id      = MACH_NURI_ID;
+        s5pc210_binfo.smp_bootreg_addr = S5PC210_SECOND_CPU_BOOTREG;
         break;
     case BOARD_S5PC210_SMDKC210:
         s5pc210_binfo.board_id = MACH_SMDKC210_ID;
+        s5pc210_binfo.smp_bootreg_addr = S5PC210_SECOND_CPU_BOOTREG;
         break;
     default:
         break;
@@ -353,6 +363,20 @@ static void s5pc210_init(ram_addr_t ram_size,
     memory_region_add_subregion(system_mem, S5PC210_DRAM0_BASE_ADDR,
             dram0_mem);
 
+    /*
+     * Secondary CPU startup code will be placed here.
+     */
+    memory_region_init_ram(hack_mem, NULL, "s5pc210.hack", 0x1000);
+    memory_region_add_subregion(system_mem, S5PC210_SMP_BOOT_ADDR,
+            hack_mem);
+
+    /*
+     * Hack: Map SECOND_CPU_BOOTREG, because it is in PMU USER5 register.
+     */
+    memory_region_init_ram(bootreg_mem, NULL, "s5pc210.bootreg", 0x4);
+    memory_region_add_subregion(system_mem, S5PC210_SECOND_CPU_BOOTREG,
+            bootreg_mem);
+
     /* CMU */
     sysbus_create_simple("s5pc210.cmu", S5PC210_CMU_BASE_ADDR, NULL);
 
@@ -429,7 +453,7 @@ static void s5pc210_init(ram_addr_t ram_size,
     s5pc210_binfo.kernel_filename = kernel_filename;
     s5pc210_binfo.initrd_filename = initrd_filename;
     s5pc210_binfo.kernel_cmdline = kernel_cmdline;
-
+    s5pc210_binfo.smp_priv_base = S5PC210_SMP_PRIVATE_BASE_ADDR;
 
     arm_load_kernel(first_cpu, &s5pc210_binfo);
 }
Signature · 1 line
1.7.4.1
#10 lore raw

PATCH 9/14 hw/lan9118.c: Basic byte/word/long access support.

In reply to Evgeny Voevodin

We included this chip into s5pc210 platform because SMDK board holds lan9215 chip. Difference is that 9215 access is 16-bit wide and some registers differ. By addition basic 16-bit access to 9118 emulation we achieved ethernet controller support by Linux lernel on SMDK boards.

---
 hw/lan9118.c |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 90 insertions(+), 6 deletions(-)
hw/lan9118.c +90 -6
index ee8b2ea..7aebabd 100644
@@ -212,6 +212,14 @@ typedef struct {
     int rxp_offset;
     int rxp_size;
     int rxp_pad;
+
+    uint32_t write_word_prev_offset;
+    uint32_t write_word_n;
+    uint16_t write_word_l;
+    uint16_t write_word_h;
+    uint32_t read_word_prev_offset;
+    uint32_t read_word_n;
+    uint32_t read_long;
 } lan9118_state;
 
 static void lan9118_update(lan9118_state *s)
@@ -345,6 +353,9 @@ static void lan9118_reset(DeviceState *d)
     s->mac_mii_data = 0;
     s->mac_flow = 0;
 
+    s->read_word_n = 0;
+    s->write_word_n = 0;
+
     phy_reset(s);
 
     s->eeprom_writable = 0;
@@ -896,11 +907,11 @@ static void lan9118_tick(void *opaque)
 }
 
 static void lan9118_writel(void *opaque, target_phys_addr_t offset,
-                           uint64_t val, unsigned size)
+                           uint32_t val)
 {
     lan9118_state *s = (lan9118_state *)opaque;
     offset &= 0xff;
-    
+
     //DPRINTF("Write reg 0x%02x = 0x%08x\n", (int)offset, val);
     if (offset >= 0x20 && offset < 0x40) {
         /* TX FIFO */
@@ -1029,8 +1040,43 @@ static void lan9118_writel(void *opaque, target_phys_addr_t offset,
     lan9118_update(s);
 }
 
-static uint64_t lan9118_readl(void *opaque, target_phys_addr_t offset,
-                              unsigned size)
+static void lan9118_writeb(void *opaque, target_phys_addr_t offset,
+                           uint32_t val)
+{
+    hw_error("lan9118_writeb: Bad reg 0x%x = %x\n", (int)offset, val);
+}
+
+static void lan9118_writew(void *opaque, target_phys_addr_t offset,
+                           uint32_t val)
+{
+    lan9118_state *s = (lan9118_state *)opaque;
+    offset &= 0xff;
+
+    /* TODO: Implement fair word operation, because this implementation
+     * assumes that any register is accessed as two 16-bit operations. */
+
+    if (s->write_word_prev_offset != (offset & ~0x3)) {
+        /* New offset, reset word counter */
+        s->write_word_n = 0;
+        s->write_word_prev_offset = offset & ~0x3;
+    }
+
+    if (offset & 0x2) {
+        s->write_word_h = val;
+    } else {
+        s->write_word_l = val;
+    }
+
+    //DPRINTF("Writew reg 0x%02x = 0x%08x\n", (int)offset, val);
+    s->write_word_n++;
+    if (s->write_word_n == 2) {
+        s->write_word_n = 0;
+        lan9118_writel(s, offset & ~3, s->write_word_l +
+                (s->write_word_h << 16));
+    }
+}
+
+static uint32_t lan9118_readl(void *opaque, target_phys_addr_t offset)
 {
     lan9118_state *s = (lan9118_state *)opaque;
 
@@ -1103,9 +1149,47 @@ static uint64_t lan9118_readl(void *opaque, target_phys_addr_t offset,
     return 0;
 }
 
+static uint32_t lan9118_readb(void *opaque, target_phys_addr_t offset)
+{
+    hw_error("lan9118_readb: Bad reg 0x%x\n", (int)offset);
+}
+
+static uint32_t lan9118_readw(void *opaque, target_phys_addr_t offset)
+{
+    lan9118_state *s = (lan9118_state *)opaque;
+    uint32_t val;
+
+    /* TODO: Implement fair word operation, because this implementation
+     * assumes that any register is accessed as two 16-bit operations. */
+
+    if (s->read_word_prev_offset != (offset & ~0x3)) {
+        /* New offset, reset word counter */
+        s->read_word_n = 0;
+        s->read_word_prev_offset = offset & ~0x3;
+    }
+
+    s->read_word_n++;
+    if (s->read_word_n == 1) {
+        s->read_long = lan9118_readl(s, offset & ~3);
+    } else {
+        s->read_word_n = 0;
+    }
+
+    if (offset & 2) {
+        val = s->read_long >> 16;
+    } else {
+        val = s->read_long & 0xFFFF;
+    }
+
+    //DPRINTF("Readw reg 0x%02x, val 0x%x\n", (int)offset, val);
+    return val;
+}
+
 static const MemoryRegionOps lan9118_mem_ops = {
-    .read = lan9118_readl,
-    .write = lan9118_writel,
+    .old_mmio = {
+        .read = { lan9118_readb, lan9118_readw, lan9118_readl, },
+        .write = { lan9118_writeb, lan9118_writew, lan9118_writel, },
+    },
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
Signature · 1 line
1.7.4.1
#11 lore raw

Re: [Qemu-devel] [PATCH 09/14] hw/lan9118.c: Basic byte/word/long access support.

Quoted 4 lines · Evgeny Voevodin

We included this chip into s5pc210 platform because SMDK board holds lan9215 chip. Difference is that 9215 access is 16-bit wide and some registers differ. By addition basic 16-bit access to 9118 emulation we achieved ethernet controller support by Linux lernel on SMDK boards.

If it differs then shouldn't we add a new qdev device for 9215 ? (sharing most of the implementation code, obviously)

Quoted 9 lines

 static const MemoryRegionOps lan9118_mem_ops = {
-    .read = lan9118_readl,
-    .write = lan9118_writel,
+    .old_mmio = {
+        .read = { lan9118_readb, lan9118_readw, lan9118_readl, },
+        .write = { lan9118_writeb, lan9118_writew, lan9118_writel, },
+    },
    .endianness = DEVICE_NATIVE_ENDIAN,
 };

This is going backwards -- the .old_mmio hooks are for backwards compatibility when converting old devices to MemoryRegions -- they shouldn't be added in new code.

You need to make the lan9118_read/write functions look at their 'size' argument instead.

-- PMM

#12 lore raw

Re: [Qemu-devel] [PATCH 09/14] hw/lan9118.c: Basic byte/word/long access support.

Quoted 9 lines · Peter Maydell
Quoted 4 lines · Evgeny Voevodin

We included this chip into s5pc210 platform because SMDK board holds lan9215 chip. Difference is that 9215 access is 16-bit wide and some registers differ. By addition basic 16-bit access to 9118 emulation we achieved ethernet controller support by Linux lernel on SMDK boards.

If it differs then shouldn't we add a new qdev device for 9215 ? (sharing most of the implementation code, obviously)

This patch could be interpreted as lan9118 emulation expansion since this chip supports 16-bit access too. These changes don't cover all the difference between 9118 and 9215, but it's enough to provide network support to Samsung boards. When 9215 support will be added we can easily switch to this chip.

Quoted 20 lines

hw/lan9118.c static uint64_t lan9118_readl(void *opaque, target_phys_addr_t offset, · line 1194

Quoted 9 lines
  static const MemoryRegionOps lan9118_mem_ops = {
hw/lan9118.c +4 -2
-    .read = lan9118_readl,
-    .write = lan9118_writel,
+    .old_mmio = {
+        .read = { lan9118_readb, lan9118_readw, lan9118_readl, },
+        .write = { lan9118_writeb, lan9118_writew, lan9118_writel, },
+    },
     .endianness = DEVICE_NATIVE_ENDIAN,
  };

This is going backwards -- the .old_mmio hooks are for backwards compatibility when converting old devices to MemoryRegions -- they shouldn't be added in new code.

You need to make the lan9118_read/write functions look at their 'size' argument instead.

-- PMM

#13 lore raw

Re: [Qemu-devel] [PATCH 09/14] hw/lan9118.c: Basic byte/word/long access support.

Quoted 14 lines · Evgeny Voevodin
Quoted 12 lines · Peter Maydell
Quoted 5 lines · Evgeny Voevodin

We included this chip into s5pc210 platform because SMDK board holds lan9215 chip. Difference is that 9215 access is 16-bit wide and some registers differ. By addition basic 16-bit access to 9118 emulation we achieved ethernet controller support by Linux lernel on SMDK boards.

If it differs then shouldn't we add a new qdev device for 9215 ? (sharing most of the implementation code, obviously)

Quoted 5 lines

This patch could be interpreted as lan9118 emulation expansion since this chip supports 16-bit access too. These changes don't cover all the difference between 9118 and 9215, but it's enough to provide network support to Samsung boards. When 9215 support will be added we can easily switch to this chip.

If you're adding a legitimate missing feature (16 bit access support) to lan9118 then your commit message should say so, not talk about 9215. The right place to say "this should be a 9215 but the 9118 is close enough" is in the patch adding the network chip to the board model, not in the commit adding a feature to the network chip model.

We should probably make 16 vs 32 bit be a qdev property of lan9118 (corresponding to the way the hardware is configured by an input pin on startup) and reflect this properly in the HW_CFG register.

Also, this todo comment is too obscure:
+ /* TODO: Implement fair word operation, because this implementation
+ * assumes that any register is accessed as two 16-bit operations. */

I have no idea what it means.

-- PMM

#14 lore raw

PATCH 10/14 hw/s5pc210.c: Add lan9118 support to SMDK board.

In reply to Evgeny Voevodin
---
 hw/s5pc210.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
hw/s5pc210.c +19 -0
index 90858e9..8678b97 100644
@@ -29,6 +29,8 @@
 #include "sysemu.h"
 #include "sysbus.h"
 #include "arm-misc.h"
+#include "net.h"
+#include "devices.h"
 #include "exec-memory.h"
 #include "s5pc210.h"
 
@@ -229,6 +231,8 @@ static void s5pc210_init(ram_addr_t ram_size,
     SysBusDevice *busdev;
     ram_addr_t mem_size;
     int n;
+    NICInfo *nd;
+    int done_nic = 0;
 
     switch (board_type) {
     case BOARD_S5PC210_NURI:
@@ -446,6 +450,21 @@ static void s5pc210_init(ram_addr_t ram_size,
         s5pc210_uart_create(addr, fifo_size, channel, NULL, uart_irq);
     }
 
+    /*** LAN adapter ***/
+    if (board_type == BOARD_S5PC210_SMDKC210) {
+
+        for (n = 0; n < nb_nics; n++) {
+            nd = &nd_table[n];
+
+            if (!done_nic && (!nd->model ||
+                    strcmp(nd->model, "lan9118") == 0)) {
+                lan9118_init(nd, 0x05000000,
+                        qemu_irq_invert(irq_table[s5pc210_get_irq(37, 1)]));
+                done_nic = 1;
+            }
+        }
+    }
+
     /*** Load kernel ***/
 
     s5pc210_binfo.ram_size = ram_size;
Signature · 1 line
1.7.4.1
#15 lore raw

PATCH 11/14 ARM: s5pc210: added s5pc210 display controller device (FIMD)

In reply to Evgeny Voevodin

From: Mitsyanko Igor <[email protected]>

---
 Makefile.target   |    2 +-
 hw/s5pc210.c      |   11 +
 hw/s5pc210_fimd.c | 1698 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1710 insertions(+), 1 deletions(-)
 create mode 100644 hw/s5pc210_fimd.c
Makefile.target +1 -1
index 805993b..84c4a05 100644
@@ -345,7 +345,7 @@ obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o s5pc210_gic.o \
-             s5pc210_combiner.o s5pc210_pwm.o s5pc210_mct.o
+             s5pc210_combiner.o s5pc210_pwm.o s5pc210_mct.o s5pc210_fimd.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c +11 -0
index 8678b97..c7cba3e 100644
@@ -97,6 +97,10 @@
 /* MCT */
 #define S5PC210_MCT_BASE_ADDR            0x10050000
 
+/* Display controllers (FIMD) */
+#define S5PC210_FIMD0_BASE_ADDR          0x11C00000
+#define S5PC210_FIMD1_BASE_ADDR          0x12000000
+
 #define S5PC210_BASE_BOOT_ADDR           S5PC210_DRAM0_BASE_ADDR
 
 /* Secondary CPU startup code is in IROM memory */
@@ -465,6 +469,13 @@ static void s5pc210_init(ram_addr_t ram_size,
         }
     }
 
+    /*** Display controller (FIMD) ***/
+    sysbus_create_varargs("s5pc210.fimd", S5PC210_FIMD0_BASE_ADDR,
+            irq_table[s5pc210_get_irq(11, 0)],
+            irq_table[s5pc210_get_irq(11, 1)],
+            irq_table[s5pc210_get_irq(11, 2)],
+            NULL);
+
     /*** Load kernel ***/
 
     s5pc210_binfo.ram_size = ram_size;
hw/s5pc210_fimd.c new file +1698 -0

1,698 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#16 lore raw

PATCH 12/14 SD card: add query function to check wether SD card currently ready to recieve data Before executing data transfer to card, we must check that previously issued command wasn't a simple query command (for ex. CMD13), which doesn't require data transfer. Currently, we only can aquire information about whether SD card is in sending data state or not. This patch allows us to query wether previous command was data write command and it was successfully accepted by card (meaning that SD card in recieving data state).

In reply to Evgeny Voevodin

From: Mitsyanko Igor <[email protected]>

---
 hw/sd.c |    5 +++++
 hw/sd.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
hw/sd.c +5 -0
index 10e26ad..ddb9d39 100644
@@ -1670,3 +1670,8 @@ void sd_enable(SDState *sd, int enable)
 {
     sd->enable = enable;
 }
+
+int sd_recieve_ready(SDState *sd)
+{
+    return sd->state == sd_receivingdata_state;
+}
hw/sd.h +1 -0
index ac4b7c4..782c8d6 100644
@@ -75,5 +75,6 @@ uint8_t sd_read_data(SDState *sd);
 void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert);
 int sd_data_ready(SDState *sd);
 void sd_enable(SDState *sd, int enable);
+int sd_recieve_ready(SDState *sd);
 
 #endif	/* __hw_sd_h */
Signature · 1 line
1.7.4.1
#17 lore raw

PATCH 13/14 ARM: s5pc210: added SD/MMC host controller (ver. 2.0 compliant) implementation

In reply to Evgeny Voevodin

From: Mitsyanko Igor <[email protected]>

---
 Makefile.target   |    3 +-
 hw/s5pc210.c      |   20 +
 hw/s5pc210_sdhc.c | 1693 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1715 insertions(+), 1 deletions(-)
 create mode 100644 hw/s5pc210_sdhc.c
Makefile.target +2 -1
index 84c4a05..be51dbf 100644
@@ -345,7 +345,8 @@ obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 obj-arm-y += versatile_pci.o
 obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 obj-arm-y += s5pc210.o s5pc210_cmu.o s5pc210_uart.o s5pc210_gic.o \
-             s5pc210_combiner.o s5pc210_pwm.o s5pc210_mct.o s5pc210_fimd.o
+             s5pc210_combiner.o s5pc210_pwm.o s5pc210_mct.o s5pc210_fimd.o \
+             s5pc210_sdhc.o
 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 obj-arm-y += pl061.o
 obj-arm-y += arm-semi.o
hw/s5pc210.c +20 -0
index c7cba3e..8892f0a 100644
@@ -97,6 +97,12 @@
 /* MCT */
 #define S5PC210_MCT_BASE_ADDR            0x10050000
 
+/* SD/MMC host controllers SFR base addresses */
+#define S5PC210_SDHC0_BASE_ADDR          0x12510000
+#define S5PC210_SDHC1_BASE_ADDR          0x12520000
+#define S5PC210_SDHC2_BASE_ADDR          0x12530000
+#define S5PC210_SDHC3_BASE_ADDR          0x12540000
+
 /* Display controllers (FIMD) */
 #define S5PC210_FIMD0_BASE_ADDR          0x11C00000
 #define S5PC210_FIMD1_BASE_ADDR          0x12000000
@@ -454,6 +460,20 @@ static void s5pc210_init(ram_addr_t ram_size,
         s5pc210_uart_create(addr, fifo_size, channel, NULL, uart_irq);
     }
 
+    /*** SD/MMC host controllers ***/
+
+    sysbus_create_simple("s5pc210.sdhc", S5PC210_SDHC0_BASE_ADDR,
+            irq_table[s5pc210_get_irq(29, 0)]);
+
+    sysbus_create_simple("s5pc210.sdhc", S5PC210_SDHC1_BASE_ADDR,
+            irq_table[s5pc210_get_irq(29, 1)]);
+
+    sysbus_create_simple("s5pc210.sdhc", S5PC210_SDHC2_BASE_ADDR,
+            irq_table[s5pc210_get_irq(29, 2)]);
+
+    sysbus_create_simple("s5pc210.sdhc", S5PC210_SDHC3_BASE_ADDR,
+            irq_table[s5pc210_get_irq(29, 3)]);
+
     /*** LAN adapter ***/
     if (board_type == BOARD_S5PC210_SMDKC210) {
 
hw/s5pc210_sdhc.c new file +1693 -0

1,693 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#18 lore raw

PATCH 14/14 s5pc210: Switch to sysbus_init_mmio.

In reply to Evgeny Voevodin
---
 hw/s5pc210_cmu.c      |    2 +-
 hw/s5pc210_combiner.c |    2 +-
 hw/s5pc210_fimd.c     |    2 +-
 hw/s5pc210_gic.c      |    4 ++--
 hw/s5pc210_mct.c      |    2 +-
 hw/s5pc210_pwm.c      |    2 +-
 hw/s5pc210_sdhc.c     |    2 +-
 hw/s5pc210_uart.c     |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)
hw/s5pc210_cmu.c +1 -1
index 12fba47..b8f0e5d 100644
@@ -1121,7 +1121,7 @@ static int s5pc210_cmu_init(SysBusDevice *dev)
     /* memory mapping */
     memory_region_init_io(&s->iomem, &s5pc210_cmu_ops, s, "s5pc210.cmu",
                           S5PC210_CMU_REGS_MEM_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     qemu_register_reset(s5pc210_cmu_reset, s);
 
hw/s5pc210_combiner.c +1 -1
index 04ae024..680e761 100644
@@ -352,7 +352,7 @@ static int s5pc210_combiner_init(SysBusDevice *dev)
 
     memory_region_init_io(&s->iomem, &s5pc210_combiner_ops, s,
             "s5pc210-combiner", IIC_REGION_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     s5pc210_combiner_reset(s);
     vmstate_register(NULL, -1, &VMState_S5pc210Combiner, s);
hw/s5pc210_fimd.c +1 -1
index b3b01f2..77174ee 100644
@@ -1675,7 +1675,7 @@ static int s5pc210_fimd_init(SysBusDevice *dev)
 
     memory_region_init_io(&s->iomem, &s5pc210_fimd_mmio_ops, s, "s5pc210.fimd",
             FIMD_REGS_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
     s->console = graphic_console_init(s5pc210_fimd_update,
                                       s5pc210_fimd_invalidate, NULL, NULL, s);
 
hw/s5pc210_gic.c +2 -2
index c6f18d4..4eeeae1 100644
@@ -386,8 +386,8 @@ static int s5pc210_gic_init(SysBusDevice *dev)
     memory_region_init_io(&s->dist_container, &s5pc210_gic_dist_ops, &s->gic,
             "s5pc210-gic-dist", S5PC210_GIC_DIST_REGION_SIZE);
 
-    sysbus_init_mmio_region(dev, &s->cpu_container);
-    sysbus_init_mmio_region(dev, &s->dist_container);
+    sysbus_init_mmio(dev, &s->cpu_container);
+    sysbus_init_mmio(dev, &s->dist_container);
 
     gic_cpu_write(&s->gic, 1, 0, 1);
     return 0;
hw/s5pc210_mct.c +1 -1
index 7a7dd84..adb0a2c 100644
@@ -1465,7 +1465,7 @@ static int s5pc210_mct_init(SysBusDevice *dev)
 
     memory_region_init_io(&s->iomem, &s5pc210_mct_ops, s, "s5pc210-mct",
             MCT_SFR_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     s5pc210_mct_reset(s);
 
hw/s5pc210_pwm.c +1 -1
index 5dfaa41..8b280d1 100644
@@ -415,7 +415,7 @@ static int s5pc210_pwm_init(SysBusDevice *dev)
 
     memory_region_init_io(&s->iomem, &s5pc210_pwm_ops, s, "s5pc210-pwm",
             S5PC210_PWM_REG_MEM_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     s5pc210_pwm_reset(s);
 
hw/s5pc210_sdhc.c +1 -1
index dbbb885..8aecf51 100644
@@ -1648,7 +1648,7 @@ static int s5pc210_sdhc_init(SysBusDevice *dev)
     sysbus_init_irq(dev, &s->irq);
     memory_region_init_io(&s->iomem, &s5pc210_sdhc_mmio_ops, s, "s5pc210.sdhc",
             SDHC_REG_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
     bd = drive_get_next(IF_SD);
 
     if ((bd == NULL)) {
hw/s5pc210_uart.c +1 -1
index d1fbddc..3870740 100644
@@ -644,7 +644,7 @@ static int s5pc210_uart_init(SysBusDevice *dev)
     /* memory mapping */
     memory_region_init_io(&s->iomem, &s5pc210_uart_ops, s, "s5pc210.uart",
                           S5PC210_UART_REGS_MEM_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     sysbus_init_irq(dev, &s->irq);
 
Signature · 1 line
1.7.4.1
#19 lore raw

Re: [Qemu-devel] [PATCH 14/14] s5pc210: Switch to sysbus_init_mmio.

Quoted 18 lines · Evgeny Voevodin

---
 hw/s5pc210_cmu.c      |    2 +-
 hw/s5pc210_combiner.c |    2 +-
 hw/s5pc210_fimd.c     |    2 +-

 hw/s5pc210_gic.c      |    4 ++--
 hw/s5pc210_mct.c      |    2 +-
 hw/s5pc210_pwm.c      |    2 +-
 hw/s5pc210_sdhc.c     |    2 +-
 hw/s5pc210_uart.c     |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)
hw/s5pc210_cmu.c +0 -0
index 12fba47..b8f0e5d 100644

hw/s5pc210_cmu.c static int s5pc210_cmu_init(SysBusDevice *dev) · line 1126

Quoted 7 lines
hw/s5pc210_cmu.c +1 -1
@@ -1121,7 +1121,7 @@ static int s5pc210_cmu_init(SysBusDevice *dev)
     /* memory mapping */
     memory_region_init_io(&s->iomem, &s5pc210_cmu_ops, s, "s5pc210.cmu",
                           S5PC210_CMU_REGS_MEM_SIZE);
-    sysbus_init_mmio_region(dev, &s->iomem);
+    sysbus_init_mmio(dev, &s->iomem);
 
     qemu_register_reset(s5pc210_cmu_reset, s);

These changes need to be folded in with the earlier patches, otherwise they will not compile. Each patch in the series should be correct as it stands, not broken and fixed up by a later patch.

-- PMM

#20 lore raw
In reply to Evgeny Voevodin
Quoted 2 lines · Evgeny Voevodin

This set of patches adds support for Samsung S5PC210-based boards NURI and SMDKC210. Tested on Linux kernel v3.x series.

I'm a bit confused by the naming here -- which Linux kernel mach-* directory does this correspond to? I can see a mach-s5pc100 and a mach-s5pv210 but no mach-s5pc210. The NURE and SMDKC210 board source files seem to be in the mach-exynos4 directory.

-- PMM

#21 lore raw

Dear Peter,

Orion, s5pc210 and Exynos4210 are aliases for the same hardware chip.
We decided that s5pc210 is more informative than exynos4 (there are many hardware models started with Exynos4...) or Orion(obsolete one).

Thanks,
Dmitry Solodkiy,
Mobile SW PL, Advanced Software Group,
Moscow R&D center, Samsung Electronics

-----Original Message-----
From: Peter Maydell [mailto:[email protected]]
Sent: Wednesday, December 07, 2011 2:34 PM
To: Evgeny Voevodin
Cc: [email protected]; [email protected]
Subject: Re: [Qemu-devel] [PATCH 00/14] ARM: Samsung S5PC210-based boards support.

Quoted 2 lines · Evgeny Voevodin

This set of patches adds support for Samsung S5PC210-based boards NURI and SMDKC210. Tested on Linux kernel v3.x series.

I'm a bit confused by the naming here -- which Linux kernel mach-* directory does this correspond to? I can see a mach-s5pc100 and a mach-s5pv210 but no mach-s5pc210. The NURE and SMDKC210 board source files seem to be in the mach-exynos4 directory.

-- PMM

#22 lore raw
Quoted 5 lines · Dmitry Solodkiy

Dear Peter,

 Orion, s5pc210 and Exynos4210 are aliases for the same hardware chip. We decided that s5pc210 is more informative than exynos4 (there are many hardware models started with Exynos4...) or Orion(obsolete one).

Hmm. You know the SoC better than I do, but I'm a bit dubious about using a different naming scheme than the kernel does. u-boot is currently working on a renaming too (eg patches being
submitted: http://patchwork.ozlabs.org/patch/129922/)

-- PMM

#23 lore raw
Quoted 7 lines · Peter Maydell
Quoted 5 lines · Dmitry Solodkiy

Dear Peter,

 Orion, s5pc210 and Exynos4210 are aliases for the same hardware chip. We decided that s5pc210 is more informative than exynos4 (there are many hardware models started with Exynos4...) or Orion(obsolete one).

Quoted 8 lines

Hmm. You know the SoC better than I do, but I'm a bit dubious about using a different naming scheme than the kernel does. u-boot is currently working on a renaming too (eg patches being
submitted: http://patchwork.ozlabs.org/patch/129922/)

-- PMM

In u-boot

To replace arch-s5pc2xx by arch-exynos is also proposed
http://www.mail-archive.com/[email protected]/msg72104.html

#24 lore raw
In reply to Peter Maydell

Dear Peter,

Well, for a long-term Exynos keyword would be better so we're going to use it in the next patch proposal (estimated today (09.12) or next Monday).

Thanks,
Dmitry Solodkiy,
Mobile SW PL, Advanced Software Group,
Moscow R&D center, Samsung Electronics

-----Original Message-----
From: Peter Maydell [mailto:[email protected]]
Sent: Thursday, December 08, 2011 2:58 PM
To: Dmitry Solodkiy
Cc: [email protected]; Evgeny Voevodin
Subject: Re: [Qemu-devel] [PATCH 00/14] ARM: Samsung S5PC210-based boards support.

Quoted 5 lines · Dmitry Solodkiy

Dear Peter,

Orion, s5pc210 and Exynos4210 are aliases for the same hardware chip. We decided that s5pc210 is more informative than exynos4 (there are
many hardware models started with Exynos4...) or Orion(obsolete one).

Hmm. You know the SoC better than I do, but I'm a bit dubious about using a different naming scheme than the kernel does. u-boot is currently working on a renaming too (eg patches being
submitted: http://patchwork.ozlabs.org/patch/129922/)

-- PMM