hw/sparc: Map the UART devices unconditionally
cover hw/sparc: Map the UART devices unconditionally
Few more SPARC patches.
Mark/Artyom/Frederic if you Ack them I'll simply add them to the current trivial SPARC patch queue I prepared.
Regards,
Phil.
Philippe Mathieu-Daudé (3):
hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition hw/sparc64/niagara: Map the UART device unconditionally
hw/sparc/leon3.c | 18 ++++++++---------- hw/sparc64/niagara.c | 7 ++----- 2 files changed, 10 insertions(+), 15 deletions(-)
Signature · 1 line
2.21.3
PATCH 1/3 hw/sparc/leon3: Map the UART device unconditionally
The UART is present on the chipset regardless there is a character device connected to it. Map it unconditionally.
--- hw/sparc/leon3.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
hw/sparc/leon3.c +8 -10
@@ -339,16 +339,14 @@ static void leon3_generic_hw_init(MachineState *machine) 0, LEON3_TIMER_IRQ, GRLIB_APBIO_AREA);/* Allocate uart */ -if (serial_hd (0 )) { - dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART ); -qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); -qdev_init_nofail (dev); -sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); -sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); -grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , -GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , -LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); - } + dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART ); +qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); +qdev_init_nofail (dev); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); +grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , +GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , +LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); }static void leon3_generic_machine_init (MachineClass *mc)
Signature · 1 line
2.21.3
Re: [PATCH 1/3] hw/sparc/leon3: Map the UART device unconditionally
Le 6/8/20 à 7:21 PM, Philippe Mathieu-Daudé a écrit :
Quoted 28 lines
The UART is present on the chipset regardless there is a character device connected to it. Map it unconditionally.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/sparc/leon3.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)hw/sparc/leon3.c +1
-10@@ -339,16 +339,14 @@ static void leon3_generic_hw_init(MachineState *machine) 0, LEON3_TIMER_IRQ, GRLIB_APBIO_AREA);/* Allocate uart */ -if (serial_hd (0 )) { - dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART ); -qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); -qdev_init_nofail (dev); -sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); -sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); -grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , -GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , -LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); - } + dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART );
hw/sparc/leon3.c static void leon3_generic_hw_init(MachineState *machine) · line 352
Quoted 10 lines
hw/sparc/leon3.c +7
-0+qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); +qdev_init_nofail (dev); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); +grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , +GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , +LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); }static void leon3_generic_machine_init (MachineClass *mc)
Thanks!
Artyom Tarasenko
Acked-byRe: [PATCH 1/3] hw/sparc/leon3: Map the UART device unconditionally
Quoted 40 lines · Fred Konrad
Quoted 36 lines · Philippe Mathieu-Daudé
The UART is present on the chipset regardless there is a character device connected to it. Map it unconditionally.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/sparc/leon3.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)hw/sparc/leon3.c +8
-10@@ -339,16 +339,14 @@ static void leon3_generic_hw_init(MachineState *machine) 0, LEON3_TIMER_IRQ, GRLIB_APBIO_AREA);/* Allocate uart */ -if (serial_hd (0 )) { - dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART ); -qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); -qdev_init_nofail (dev); -sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); -sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); -grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , -GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , -LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); - } + dev =qdev_create (NULL ,TYPE_GRLIB_APB_UART ); +qdev_prop_set_chr (dev,"chrdev" ,serial_hd (0 )); +qdev_init_nofail (dev); +sysbus_mmio_map (SYS_BUS_DEVICE (dev),0 ,LEON3_UART_OFFSET ); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , cpu_irqs[LEON3_UART_IRQ ]); +grlib_apb_pnp_add_entry (apb_pnp,LEON3_UART_OFFSET ,0xFFF , +GRLIB_VENDOR_GAISLER ,GRLIB_APBUART_DEV ,1 , +LEON3_UART_IRQ ,GRLIB_APBIO_AREA ); }
Quoted 4 lines
hw/sparc/leon3.c static void leon3_generic_hw_init(MachineState *machine) · line 352
Quoted 2 lines
hw/sparc/leon3.c +0
-0static void leon3_generic_machine_init (MachineClass *mc)Reviewed-by KONRAD Frederic <[email protected]>
--
Regards,
Artyom Tarasenko
SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
PATCH 2/3 hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition
In reply to Philippe Mathieu-DaudéNIAGARA_UART_BASE is already defined few lines earlier.
--- hw/sparc64/niagara.c | 1 - 1 file changed, 1 deletion(-)
hw/sparc64/niagara.c +0 -1
@@ -68,7 +68,6 @@ typedef struct NiagaraBoardState {#define NIAGARA_VDISK_BASE 0x1f40000000ULL#define NIAGARA_RTC_BASE 0xfff0c1fff8ULL -#define NIAGARA_UART_BASE 0x1f10000000ULL/* Firmware layout *
Signature · 1 line
2.21.3
Re: [PATCH 2/3] hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition
Quoted 4 lines · Philippe Mathieu-Daudé
NIAGARA_UART_BASEis already defined few lines earlier.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Quoted 19 lines
--- hw/sparc64/niagara.c | 1 - 1 file changed, 1 deletion(-)hw/sparc64/niagara.c +0
-2@@ -68,7 +68,6 @@ typedef struct NiagaraBoardState {#define NIAGARA_VDISK_BASE 0x1f40000000ULL#define NIAGARA_RTC_BASE 0xfff0c1fff8ULL -#define NIAGARA_UART_BASE 0x1f10000000ULL/* Firmware layout * -- 2.21.3
Signature · 4 lines
Regards, Artyom Tarasenko SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
PATCH 3/3 hw/sparc64/niagara: Map the UART device unconditionally
In reply to Philippe Mathieu-DaudéThe UART is present on the machine regardless there is a character device connected to it. Map it unconditionally.
--- hw/sparc64/niagara.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
hw/sparc64/niagara.c +2 -4
@@ -151,10 +151,8 @@ static void niagara_init(MachineState *machine)exit (1 ); } } -if (serial_hd (0 )) { -serial_mm_init (sysmem,NIAGARA_UART_BASE ,0 ,NULL ,115200 , -serial_hd (0 ),DEVICE_BIG_ENDIAN ); - } +serial_mm_init (sysmem,NIAGARA_UART_BASE ,0 ,NULL , +115200 ,serial_hd (0 ),DEVICE_BIG_ENDIAN );create_unimplemented_device ("sun4v-iob" ,NIAGARA_IOBBASE ,NIAGARA_IOBSIZE );sun4v_rtc_init (NIAGARA_RTC_BASE ); }
Signature · 1 line
2.21.3
Re: [PATCH 3/3] hw/sparc64/niagara: Map the UART device unconditionally
Quoted 5 lines · Philippe Mathieu-Daudé
The UART is present on the machine regardless there is a character device connected to it. Map it unconditionally.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 24 lines
--- hw/sparc64/niagara.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)hw/sparc64/niagara.c +2
-5@@ -151,10 +151,8 @@ static void niagara_init(MachineState *machine)exit (1 ); } } -if (serial_hd (0 )) { -serial_mm_init (sysmem,NIAGARA_UART_BASE ,0 ,NULL ,115200 , -serial_hd (0 ),DEVICE_BIG_ENDIAN ); - } +serial_mm_init (sysmem,NIAGARA_UART_BASE ,0 ,NULL , +115200 ,serial_hd (0 ),DEVICE_BIG_ENDIAN );create_unimplemented_device ("sun4v-iob" ,NIAGARA_IOBBASE ,NIAGARA_IOBSIZE );sun4v_rtc_init (NIAGARA_RTC_BASE ); } --2.21.3
Signature · 4 lines
Regards, Artyom Tarasenko SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
Quoted 9 lines · Philippe Mathieu-Daudé
Few more SPARC patches.
Mark/Artyom/Frederic if you Ack them I'll simply add them to the current trivial SPARC patch queue I prepared.
Regards,
Phil.
Quoted 9 lines
Philippe Mathieu-Daudé (3):
hw/sparc/leon3: Map the UART device unconditionally hw/sparc64/niagara: Remove duplicatedNIAGARA_UART_BASEdefinition hw/sparc64/niagara: Map the UART device unconditionallyhw/sparc/leon3.c | 18 ++++++++---------- hw/sparc64/niagara.c | 7 ++----- 2 files changed, 10 insertions(+), 15 deletions(-)
Thanks, series applied to for the next (temporary) sparc-next pull request.