target-arm queue
Subsystems (4)
Here's the target-arm queue; I'm a bit hesitant about the late-landing various new board/SoC patches, but they won't affect anybody who isn't trying to use those boards, so I think it's OK.
(There are a few other patches on list which I definitely want to get in before rc0 but they need a bit more review time I think.)
thanks
-- PMM
The following changes since commit 0ebc03bc065329eaefb6493f5fa7df08df528f2a:
util/base64.c: Clean includes (2016-03-16 12:48:11 +0000)
are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20160316
for you to fetch changes up to 10b27d1ab391dbf36f92e1a33179662082401d7a:
sd: Fix "info qtree" on boards with SD cards (2016-03-16 17:12:46 +0000)
----------------------------------------------------------------
target-arm queue:
* loader: Fix incorrect parameter name in load_image_mr()
* Implement MRS (banked) and MSR (banked) instructions
* virt: Implement versioning for machine model
* i.MX: some initial patches preparing for i.MX6 support
* new ASPEED AST2400 SoC and palmetto-bmc machine
* bcm2835: add some more raspi2 devices
* sd: fix segfault running "info qtree"
----------------------------------------------------------------
Andrew Baumann (2):
bcm2835_peripherals: enable sdhci pending-insert quirk for raspberry pi
bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block
Andrew Jeffery (4):
hw/timer: Add ASPEED timer device model
hw/intc: Add (new) ASPEED VIC device model
hw/arm: Add ASPEED AST2400 SoC model
hw/arm: Add palmetto-bmc machine
Grégory ESTRADE (3):
bcm2835_fb: add framebuffer device for Raspberry Pi
bcm2835_property: implement framebuffer control/configuration properties
bcm2835_dma: add emulation of Raspberry Pi DMA controller
Jean-Christophe Dubois (6):
i.MX: Allow GPT timer to rollover.
i.MX: Rename CCM NOCLK to CLK_NONE for naming consistency. i.MX: Remove CCM useless clock computation handling. i.MX: Add the CLK_IPG_HIGH clock
i.MX: Add i.MX6 CCM and ANALOG device.
i.MX: Add missing descriptions in devices.
Jens Wiklander (1):
loader: Fix incorrect parameter name in load_image_mr() macro
Peter Maydell (2):
target-arm: Implement MRS (banked) and MSR (banked) instructions
sd: Fix "info qtree" on boards with SD cards
Sergey Sorokin (1):
target-arm: Fix translation level on early translation faults
Wei Huang (2):
arm: virt: Add an abstract ARM virt machine type
arm: virt: Move machine class init code to the abstract machine type
default-configs/arm-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/ast2400.c | 137 +++++++ hw/arm/bcm2835_peripherals.c | 103 ++++- hw/arm/bcm2836.c | 2 + hw/arm/fsl-imx25.c | 1 + hw/arm/fsl-imx31.c | 1 + hw/arm/palmetto-bmc.c | 65 +++ hw/arm/raspi.c | 12 +- hw/arm/virt.c | 57 ++- hw/char/Makefile.objs | 1 + hw/char/bcm2835_aux.c | 316 ++++++++++++++ hw/display/Makefile.objs | 1 + hw/display/bcm2835_fb.c | 424 +++++++++++++++++++ hw/dma/Makefile.objs | 1 + hw/dma/bcm2835_dma.c | 408 ++++++++++++++++++ hw/i2c/imx_i2c.c | 1 + hw/intc/Makefile.objs | 1 + hw/intc/aspeed_vic.c | 339 +++++++++++++++ hw/misc/Makefile.objs | 1 + hw/misc/bcm2835_property.c | 139 ++++++- hw/misc/imx25_ccm.c | 29 +- hw/misc/imx31_ccm.c | 35 +- hw/misc/imx6_ccm.c | 774 +++++++++++++++++++++++++++++++++++ hw/net/imx_fec.c | 1 + hw/sd/sd.c | 6 +- hw/timer/Makefile.objs | 1 + hw/timer/aspeed_timer.c | 449 ++++++++++++++++++++ hw/timer/imx_epit.c | 8 +- hw/timer/imx_gpt.c | 43 +- include/hw/arm/ast2400.h | 35 ++ include/hw/arm/bcm2835_peripherals.h | 6 + include/hw/char/bcm2835_aux.h | 33 ++ include/hw/display/bcm2835_fb.h | 47 +++ include/hw/dma/bcm2835_dma.h | 47 +++ include/hw/intc/aspeed_vic.h | 48 +++ include/hw/loader.h | 2 +- include/hw/misc/bcm2835_property.h | 5 +- include/hw/misc/imx6_ccm.h | 197 +++++++++ include/hw/misc/imx_ccm.h | 10 +- include/hw/timer/aspeed_timer.h | 59 +++ target-arm/helper.c | 22 +- target-arm/helper.h | 3 + target-arm/op_helper.c | 120 ++++++ target-arm/translate.c | 246 ++++++++++- trace-events | 16 + 46 files changed, 4114 insertions(+), 140 deletions(-) create mode 100644 hw/arm/ast2400.c create mode 100644 hw/arm/palmetto-bmc.c create mode 100644 hw/char/bcm2835_aux.c create mode 100644 hw/display/bcm2835_fb.c create mode 100644 hw/dma/bcm2835_dma.c create mode 100644 hw/intc/aspeed_vic.c create mode 100644 hw/misc/imx6_ccm.c create mode 100644 hw/timer/aspeed_timer.c create mode 100644 include/hw/arm/ast2400.h create mode 100644 include/hw/char/bcm2835_aux.h create mode 100644 include/hw/display/bcm2835_fb.h create mode 100644 include/hw/dma/bcm2835_dma.h create mode 100644 include/hw/intc/aspeed_vic.h create mode 100644 include/hw/misc/imx6_ccm.h create mode 100644 include/hw/timer/aspeed_timer.h
[Qemu-devel] [PULL 16/21] bcm2835_peripherals: enable sdhci pending-insert quirk for raspberry pi
From: Andrew Baumann <[email protected]>
Message-id: [email protected]
--- hw/arm/bcm2835_peripherals.c | 7 +++++++ 1 file changed, 7 insertions(+)
hw/arm/bcm2835_peripherals.c +7 -0
@@ -171,6 +171,13 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)return ; } +object_property_set_bool (OBJECT (&s->sdhci), true,"pending-insert-quirk" , + &err); +if (err) { +error_propagate (errp, err); +return ; + } +object_property_set_bool (OBJECT (&s->sdhci), true,"realized" , &err);if (err) {error_propagate (errp, err);
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 14/21] hw/arm: Add ASPEED AST2400 SoC model
In reply to Peter MaydellFrom: Andrew Jeffery <[email protected]>
While the ASPEED AST2400 SoC[1] has a broad range of capabilities this implementation is minimal, comprising an ARM926 processor, ASPEED VIC and timer devices, and a 8250 UART.
[1] http://www.aspeedtech.com/products.php?fPath=20&rId=376
Message-id: [email protected]
--- hw/arm/Makefile.objs | 1 + hw/arm/ast2400.c | 137 +++++++++++++++++++++++++++++++++++++++++++++++ include/hw/arm/ast2400.h | 35 ++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 hw/arm/ast2400.c create mode 100644 include/hw/arm/ast2400.h
hw/arm/Makefile.objs +1 -0
@@ -16,3 +16,4 @@ 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 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o +obj-$(CONFIG_ASPEED_SOC) += ast2400.o
hw/arm/ast2400.c new file +137 -0
137 lines not on this page · raw message
include/hw/arm/ast2400.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* ASPEED AST2400 SoC +* +* Andrew Jeffery <[email protected]> +* +* Copyright 2016 IBM Corp. +* +* This code is licensed under the GPL version 2 or later. See +* the COPYING file in the top-level directory. +*/ + +#ifndef AST2400_H +#define AST2400_H + +#include "hw/arm/arm.h" +#include "hw/intc/aspeed_vic.h" +#include "hw/timer/aspeed_timer.h" + +typedef struct AST2400State { +/*< private >*/ +DeviceState parent; + +/*< public >*/ +ARMCPU *cpu; +MemoryRegion iomem; +AspeedVICState vic; +AspeedTimerCtrlState timerctrl; +}AST2400State ; + +#define TYPE_AST2400 "ast2400" +#define AST2400 (obj) OBJECT_CHECK(AST2400State, (obj), TYPE_AST2400) + +#define AST2400_SDRAM_BASE 0x40000000 + +#endif /* AST2400_H */
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 15/21] hw/arm: Add palmetto-bmc machine
In reply to Peter MaydellFrom: Andrew Jeffery <[email protected]>
The new machine is a thin layer over the AST2400 ARM926-based SoC[1]. Between the minimal machine and the current SoC implementation there is enough functionality to boot an aspeed_defconfig Linux kernel to userspace. Nothing yet is specific to the Palmetto's BMC (other than using an AST2400 SoC), but creating specific machine types is preferable to a generic machine that doesn't match any particular hardware.
[1] http://www.aspeedtech.com/products.php?fPath=20&rId=376
Message-id: [email protected]
--- hw/arm/Makefile.objs | 2 +- hw/arm/palmetto-bmc.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 hw/arm/palmetto-bmc.c
hw/arm/Makefile.objs +1 -1
@@ -16,4 +16,4 @@ 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 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o -obj-$(CONFIG_ASPEED_SOC) += ast2400.o +obj-$(CONFIG_ASPEED_SOC) += ast2400.o palmetto-bmc.o
hw/arm/palmetto-bmc.c new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 09/21] i.MX: Add the CLK_IPG_HIGH clock
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
EPIT, GPT and other i.MX timers are using "abstract" clocks among which a CLK_IPG_HIGH clock.
On i.MX25 and i.MX31 CLK_IPG and CLK_IPG_HIGH are mapped to the same clock but on other SOC like i.MX6 they are mapped to distinct clocks.
This patch add the CLK_IPG_HIGH to prepare for SOC where these 2 clocks are different.
Message-id: 224bf650194760284cb40630e985867e1373276a.1456868959.git.jcd@tribudubois.net
--- hw/misc/imx25_ccm.c | 1 + hw/misc/imx31_ccm.c | 1 + hw/timer/imx_epit.c | 8 ++++---- hw/timer/imx_gpt.c | 16 ++++++++-------- include/hw/misc/imx_ccm.h | 1 + 5 files changed, 15 insertions(+), 12 deletions(-)
hw/misc/imx25_ccm.c +1 -0
@@ -171,6 +171,7 @@ static uint32_t imx25_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)case CLK_NONE :break ;case CLK_IPG : +case CLK_IPG_HIGH : freq =imx25_ccm_get_ipg_clk (dev);break ;case CLK_32k:
hw/misc/imx31_ccm.c +1 -0
@@ -186,6 +186,7 @@ static uint32_t imx31_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)case CLK_NONE :break ;case CLK_IPG : +case CLK_IPG_HIGH : freq =imx31_ccm_get_ipg_clk (dev);break ;case CLK_32k:
hw/timer/imx_epit.c +4 -4
@@ -52,10 +52,10 @@ static char const *imx_epit_reg_name(uint32_t reg)* These are typical. */ static const IMXClk imx_epit_clocks[] = { -CLK_NONE ,/* 00 disabled */ -CLK_IPG ,/* 01 ipg_clk, ~532MHz */ -CLK_IPG ,/* 10 ipg_clk_highfreq */ - CLK_32k,/* 11 ipg_clk_32k -- ~32kHz */ +CLK_NONE ,/* 00 disabled */ +CLK_IPG ,/* 01 ipg_clk, ~532MHz */ +CLK_IPG_HIGH ,/* 10 ipg_clk_highfreq */ + CLK_32k,/* 11 ipg_clk_32k -- ~32kHz */ };/*
hw/timer/imx_gpt.c +8 -8
@@ -81,14 +81,14 @@ static const VMStateDescription vmstate_imx_timer_gpt = { };static const IMXClk imx_gpt_clocks[] = { -CLK_NONE ,/* 000 No clock source */ -CLK_IPG ,/* 001 ipg_clk, 532MHz*/ -CLK_IPG ,/* 010 ipg_clk_highfreq */ -CLK_NONE ,/* 011 not defined */ - CLK_32k,/* 100 ipg_clk_32k */ -CLK_NONE ,/* 101 not defined */ -CLK_NONE ,/* 110 not defined */ -CLK_NONE ,/* 111 not defined */ +CLK_NONE ,/* 000 No clock source */ +CLK_IPG ,/* 001 ipg_clk, 532MHz*/ +CLK_IPG_HIGH ,/* 010 ipg_clk_highfreq */ +CLK_NONE ,/* 011 not defined */ + CLK_32k,/* 100 ipg_clk_32k */ +CLK_NONE ,/* 101 not defined */ +CLK_NONE ,/* 110 not defined */ +CLK_NONE ,/* 111 not defined */ };static void imx_gpt_set_freq (IMXGPTState *s)
include/hw/misc/imx_ccm.h +1 -0
@@ -45,6 +45,7 @@ typedef struct IMXCCMState {typedef enum {CLK_NONE ,CLK_IPG , +CLK_IPG_HIGH , CLK_32k }IMXClk ;
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 05/21] arm: virt: Move machine class init code to the abstract machine type
In reply to Peter MaydellFrom: Wei Huang <[email protected]>
This patch moves the common class initialization code from "virt-2.6" to the new abstract class. An empty property is added to "virt-2.6" machine. In the meanwhile, related funtions are renamed to "virt_2_6_*" for consistency.
Message-id: [email protected]
--- hw/arm/virt.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-)
hw/arm/virt.c +20 -14
@@ -1347,6 +1347,18 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)static void virt_machine_class_init (ObjectClass *oc,void *data) { +MachineClass *mc =MACHINE_CLASS (oc); + + mc->init = machvirt_init; +/* Start max_cpus at the maximum QEMU supports. We'll further restrict +* it later in machvirt_init, where we have more information about the +* configuration of the particular instance. +*/ + mc->max_cpus =MAX_CPUMASK_BITS ; + mc->has_dynamic_sysbus = true; + mc->block_default_type =IF_VIRTIO ; + mc->no_cdrom =1 ; + mc->pci_allow_0_address = true; }static const TypeInfo virt_machine_info = {
@@ -1358,7 +1370,7 @@ static const TypeInfo virt_machine_info = { .class_init = virt_machine_class_init, }; -static void virt_instance_init (Object *obj) +static void virt_2_6_instance_init (Object *obj) {VirtMachineState *vms =VIRT_MACHINE (obj);
@@ -1391,29 +1403,23 @@ static void virt_instance_init(Object *obj) "Valid values are 2, 3 and host", NULL); } -static void virt_class_init (ObjectClass *oc,void *data) +static void virt_2_6_class_init (ObjectClass *oc,void *data) {MachineClass *mc =MACHINE_CLASS (oc); +static GlobalProperty compat_props[] = { + {/* end of list */ } + }; mc->desc ="QEMU 2.6 ARM Virtual Machine" ; mc->alias ="virt" ; - mc->init = machvirt_init; -/* Start max_cpus at the maximum QEMU supports. We'll further restrict -* it later in machvirt_init, where we have more information about the -* configuration of the particular instance. -*/ - mc->max_cpus =MAX_CPUMASK_BITS ; - mc->has_dynamic_sysbus = true; - mc->block_default_type =IF_VIRTIO ; - mc->no_cdrom =1 ; - mc->pci_allow_0_address = true; + mc->compat_props = compat_props; }static const TypeInfo machvirt_info = { .name =MACHINE_TYPE_NAME ("virt-2.6" ), .parent =TYPE_VIRT_MACHINE , - .instance_init = virt_instance_init, - .class_init = virt_class_init, + .instance_init = virt_2_6_instance_init, + .class_init = virt_2_6_class_init, };static void machvirt_machine_init (void )
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 06/21] i.MX: Allow GPT timer to rollover.
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
GPT timer need to rollover when it reaches 0xffffffff.
It also need to reset to 0 when in "restart mode" and crossing the compare 1 register.
Message-id: 6e2b36117a249a78bf822dd59a390368f407136e.1456868959.git.jcd@tribudubois.net
--- hw/timer/imx_gpt.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
hw/timer/imx_gpt.c +15 -12
@@ -134,7 +134,7 @@ static inline uint32_t imx_gpt_find_limit(uint32_t count, uint32_t reg,static void imx_gpt_compute_next_timeout (IMXGPTState *s,bool event) {uint32_t timeout =GPT_TIMER_MAX ; -uint32_t count =0 ; +uint32_t count;long long limit;if (!(s->cr &GPT_CR_EN )) {
@@ -142,20 +142,23 @@ static void imx_gpt_compute_next_timeout(IMXGPTState *s, bool event)return ; } -if (event) { -/* This is a timer event */ +/* update the count */ + count =imx_gpt_update_count (s); -if ((s->cr &GPT_CR_FRR ) && (s->next_timeout !=GPT_TIMER_MAX )) { -/* -* if we are in free running mode and we have not reached -* the GPT_TIMER_MAX limit, then update the count +if (event) { +/* +* This is an event (the ptimer reached 0 and stopped), and the +* timer counter is now equal to s->next_timeout. +*/ +if (!(s->cr &GPT_CR_FRR ) && (count == s->ocr1)) { +/* We are in restart mode and we crossed the compare channel 1 +* value. We need to reset the counter to 0. */ - count =imx_gpt_update_count (s); + count = s->cnt = s->next_timeout =0 ; + }else if (count ==GPT_TIMER_MAX ) { +/* We reached GPT_TIMER_MAX so we need to rollover */ + count = s->cnt = s->next_timeout =0 ; } - }else { -/* not a timer event, then just update the count */ - - count =imx_gpt_update_count (s); }/* now, find the next timeout related to count */
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 07/21] i.MX: Rename CCM NOCLK to CLK_NONE for naming consistency.
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
This way all CCM clock defines/enums are named CLK_XXX
Message-id: 8537df765c1713625c7a8b9aca4c7ca60b42e0c0.1456868959.git.jcd@tribudubois.net
--- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/timer/imx_epit.c | 2 +- hw/timer/imx_gpt.c | 10 +++++----- include/hw/misc/imx_ccm.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-)
hw/misc/imx25_ccm.c +1 -1
@@ -182,7 +182,7 @@ static uint32_t imx25_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)DPRINTF ("Clock = %d)\n" , clock);switch (clock) { -case NOCLK : +case CLK_NONE :break ;case CLK_MPLL : freq =imx25_ccm_get_mpll_clk (dev);
hw/misc/imx31_ccm.c +1 -1
@@ -209,7 +209,7 @@ static uint32_t imx31_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)uint32_t freq =0 ;switch (clock) { -case NOCLK : +case CLK_NONE :break ;case CLK_MCU : freq =imx31_ccm_get_mcu_clk (dev);
hw/timer/imx_epit.c +1 -1
@@ -52,7 +52,7 @@ static char const *imx_epit_reg_name(uint32_t reg)* These are typical. */ static const IMXClk imx_epit_clocks[] = { -NOCLK ,/* 00 disabled */ +CLK_NONE ,/* 00 disabled */ CLK_IPG ,/* 01 ipg_clk, ~532MHz */ CLK_IPG ,/* 10 ipg_clk_highfreq */ CLK_32k,/* 11 ipg_clk_32k -- ~32kHz */
hw/timer/imx_gpt.c +5 -5
@@ -81,14 +81,14 @@ static const VMStateDescription vmstate_imx_timer_gpt = { };static const IMXClk imx_gpt_clocks[] = { -NOCLK ,/* 000 No clock source */ +CLK_NONE ,/* 000 No clock source */ CLK_IPG ,/* 001 ipg_clk, 532MHz*/ CLK_IPG ,/* 010 ipg_clk_highfreq */ -NOCLK ,/* 011 not defined */ +CLK_NONE ,/* 011 not defined */ CLK_32k,/* 100 ipg_clk_32k */ -NOCLK ,/* 101 not defined */ -NOCLK ,/* 110 not defined */ -NOCLK ,/* 111 not defined */ +CLK_NONE ,/* 101 not defined */ +CLK_NONE ,/* 110 not defined */ +CLK_NONE ,/* 111 not defined */ };static void imx_gpt_set_freq (IMXGPTState *s)
include/hw/misc/imx_ccm.h +1 -1
@@ -43,7 +43,7 @@ typedef struct IMXCCMState { } IMXCCMState; typedef enum { - NOCLK, + CLK_NONE, CLK_MPLL, CLK_UPLL, CLK_MCU,
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 08/21] i.MX: Remove CCM useless clock computation handling.
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
Most clocks supported by the CCM are useless to the qemu framework.
Only clocks related to timers (EPIT, GPT, PWM, WATCHDOG, ...) are usefull to QEMU code.
Therefore this patch removes clock computation handling for all clocks but:
* CLK_NONE,
* CLK_IPG,
* CLK_32k
Message-id: 9e7222efb349801032e60c0f6b0fbad0e5dcf648.1456868959.git.jcd@tribudubois.net
--- hw/misc/imx25_ccm.c | 26 -------------------------- hw/misc/imx31_ccm.c | 32 -------------------------------- include/hw/misc/imx_ccm.h | 7 ------- 3 files changed, 65 deletions(-)
hw/misc/imx25_ccm.c +0 -26
@@ -120,20 +120,6 @@ static uint32_t imx25_ccm_get_mpll_clk(IMXCCMState *dev)return freq; } -static uint32_t imx25_ccm_get_upll_clk (IMXCCMState *dev) -{ -uint32_t freq =0 ; -IMX25CCMState *s =IMX25_CCM (dev); - -if (!EXTRACT (s->reg[IMX25_CCM_CCTL_REG ],UPLL_DIS )) { - freq =imx_ccm_calc_pll (s->reg[IMX25_CCM_UPCTL_REG ],CKIH_FREQ ); - } - -DPRINTF ("freq = %d\n" , freq); - -return freq; -} -static uint32_t imx25_ccm_get_mcu_clk (IMXCCMState *dev) {uint32_t freq;
@@ -184,18 +170,6 @@ static uint32_t imx25_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)switch (clock) {case CLK_NONE :break ; -case CLK_MPLL : - freq =imx25_ccm_get_mpll_clk (dev); -break ; -case CLK_UPLL : - freq =imx25_ccm_get_upll_clk (dev); -break ; -case CLK_MCU : - freq =imx25_ccm_get_mcu_clk (dev); -break ; -case CLK_AHB : - freq =imx25_ccm_get_ahb_clk (dev); -break ;case CLK_IPG : freq =imx25_ccm_get_ipg_clk (dev);break ;
hw/misc/imx31_ccm.c +0 -32
@@ -152,32 +152,6 @@ static uint32_t imx31_ccm_get_mcu_main_clk(IMXCCMState *dev)return freq; } -static uint32_t imx31_ccm_get_mcu_clk (IMXCCMState *dev) -{ -uint32_t freq; -IMX31CCMState *s =IMX31_CCM (dev); - - freq =imx31_ccm_get_mcu_main_clk (dev) - / (1 +EXTRACT (s->reg[IMX31_CCM_PDR0_REG ],MCU )); - -DPRINTF ("freq = %d\n" , freq); - -return freq; -} - -static uint32_t imx31_ccm_get_hsp_clk (IMXCCMState *dev) -{ -uint32_t freq; -IMX31CCMState *s =IMX31_CCM (dev); - - freq =imx31_ccm_get_mcu_main_clk (dev) - / (1 +EXTRACT (s->reg[IMX31_CCM_PDR0_REG ],HSP )); - -DPRINTF ("freq = %d\n" , freq); - -return freq; -} -static uint32_t imx31_ccm_get_hclk_clk (IMXCCMState *dev) {uint32_t freq;
@@ -211,12 +185,6 @@ static uint32_t imx31_ccm_get_clock_frequency(IMXCCMState *dev, IMXClk clock)switch (clock) {case CLK_NONE :break ; -case CLK_MCU : - freq =imx31_ccm_get_mcu_clk (dev); -break ; -case CLK_HSP : - freq =imx31_ccm_get_hsp_clk (dev); -break ;case CLK_IPG : freq =imx31_ccm_get_ipg_clk (dev);break ;
include/hw/misc/imx_ccm.h +0 -7
@@ -44,14 +44,7 @@ typedef struct IMXCCMState {typedef enum {CLK_NONE , -CLK_MPLL , -CLK_UPLL , -CLK_MCU , -CLK_HSP , -CLK_MAX , -CLK_AHB ,CLK_IPG , -CLK_PER , CLK_32k }IMXClk ;
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 11/21] i.MX: Add missing descriptions in devices.
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
Message-id: f1f565eb9dffdeb582feb1b15ba9e8b0afcf5468.1456868959.git.jcd@tribudubois.net
--- hw/arm/fsl-imx25.c | 1 + hw/arm/fsl-imx31.c | 1 + hw/i2c/imx_i2c.c | 1 + hw/net/imx_fec.c | 1 + 4 files changed, 4 insertions(+)
hw/arm/fsl-imx25.c +1 -0
@@ -291,6 +291,7 @@ static void fsl_imx25_class_init(ObjectClass *oc, void *data)* arm_cpu_class_init() */ dc->cannot_destroy_with_object_finalize_yet = true; + dc->desc ="i.MX25 SOC" ; }static const TypeInfo fsl_imx25_type_info = {
hw/arm/fsl-imx31.c +1 -0
@@ -265,6 +265,7 @@ static void fsl_imx31_class_init(ObjectClass *oc, void *data)* arm_cpu_class_init() */ dc->cannot_destroy_with_object_finalize_yet = true; + dc->desc ="i.MX31 SOC" ; }static const TypeInfo fsl_imx31_type_info = {
hw/i2c/imx_i2c.c +1 -0
@@ -319,6 +319,7 @@ static void imx_i2c_class_init(ObjectClass *klass, void *data) dc->vmsd = &imx_i2c_vmstate; dc->reset = imx_i2c_reset; dc->realize = imx_i2c_realize; + dc->desc ="i.MX I2C Controller" ; }static const TypeInfo imx_i2c_type_info = {
hw/net/imx_fec.c +1 -0
@@ -693,6 +693,7 @@ static void imx_fec_class_init(ObjectClass *klass, void *data) dc->reset = imx_fec_reset; dc->props = imx_fec_properties; dc->realize = imx_fec_realize; + dc->desc ="i.MX FEC Ethernet Controller" ; }static const TypeInfo imx_fec_info = {
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 01/21] loader: Fix incorrect parameter name in load_image_mr() macro
In reply to Peter MaydellFrom: Jens Wiklander <[email protected]>
Fix a typo in the load_image_mr() macro: 'mr' was written when the parameter name is '_mr'. (This had no visible effects since the single use of the macro used 'mr' as the argument.)
Fixes 76151cacfe956248a25b38b5e8429465584f47bb "loader: Add load_image_mr() to load ROM image to a MemoryRegion"
--- include/hw/loader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/loader.h +1 -1
@@ -137,7 +137,7 @@ void hmp_info_roms(Monitor *mon, const QDict *qdict);#define rom_add_blob_fixed (_f, _b, _l, _a) \ rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL)#define rom_add_file_mr (_f, _mr, _i) \ - rom_add_file(_f, NULL, 0, _i, false, mr) + rom_add_file(_f, NULL, 0, _i, false, _mr)#define PC_ROM_MIN_VGA 0xc0000#define PC_ROM_MIN_OPTION 0xc8000
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 21/21] sd: Fix "info qtree" on boards with SD cards
In reply to Peter MaydellThe SD card object is not a SysBusDevice, so don't create it with qdev_create() if we're not assigning it to a specific bus; use object_new() instead.
This was causing 'info qtree' to segfault on boards with SD cards, because qdev_create(NULL, TYPE_FOO) puts the created object on the system bus, and then we may try to run functions like sysbus_dev_print() on it, which fail when casting the object to SysBusDevice.
(This is the same mistake that we made with the NAND device and fixed in commit 6749695eaaf346c1.)
Message-id: [email protected]
--- hw/sd/sd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/sd/sd.c +4 -2
@@ -563,17 +563,19 @@ static const VMStateDescription sd_vmstate = {/* Legacy initialization function for use by non-qdevified callers */ SDState *sd_init (BlockBackend *blk,bool is_spi) { +Object *obj;DeviceState *dev;Error *err =NULL ; - dev =qdev_create (NULL ,TYPE_SD_CARD ); + obj =object_new (TYPE_SD_CARD ); + dev =DEVICE (obj);qdev_prop_set_drive (dev,"drive" , blk, &err);if (err) {error_report ("sd_init failed: %s" ,error_get_pretty (err));return NULL ; }qdev_prop_set_bit (dev,"spi" , is_spi); -object_property_set_bool (OBJECT (dev), true,"realized" , &err); +object_property_set_bool (obj, true,"realized" , &err);if (err) {error_report ("sd_init failed: %s" ,error_get_pretty (err));return NULL ;
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 03/21] target-arm: Fix translation level on early translation faults
In reply to Peter MaydellFrom: Sergey Sorokin <[email protected]>
Qemu reports translation fault on 1st level instead of 0th level in case of AArch64 address translation if the translation table walk is disabled or the address is in the gap between the two regions.
Message-id: [email protected]
--- target-arm/helper.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
target-arm/helper.c +12 -10
@@ -7237,7 +7237,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,CPUState *cs =CPU (cpu);/* Read an LPAE long-descriptor translation table. */ MMUFaultType fault_type = translation_fault; -uint32_t level =1 ; +uint32_t level;uint32_t epd =0 ;int32_t t0sz, t1sz;uint32_t tg;
@@ -7248,7 +7248,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,target_ulong page_size;uint32_t attrs;int32_t stride =9 ; -int32_t va_size =32 ; +int32_t va_size;int inputsize;int32_t tbi =0 ;TCR *tcr =regime_tcr (env, mmu_idx);
@@ -7264,6 +7264,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,* support for those page table walks. */ if (arm_el_is_aa64 (env, el)) { + level =0 ; va_size =64 ;if (el >1 ) {if (mmu_idx != ARMMMUIdx_S2NS) {
@@ -7285,6 +7286,8 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, ttbr1_valid = false; } }else { + level =1 ; + va_size =32 ;/* There is no TTBR1 for EL2 */ if (el ==2 ) { ttbr1_valid = false;
@@ -7407,27 +7410,26 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,/* For stage 2 translations the starting level is specified by the * VTCR_EL2.SL0 field (whose interpretation depends on the page size) */ -int startlevel =extract32 (tcr->raw_tcr,6 ,2 ); +uint32_t sl0 =extract32 (tcr->raw_tcr,6 ,2 ); +uint32_t startlevel;bool ok;if (va_size ==32 || stride ==9 ) {/* AArch32 or 4KB pages */ - level =2 - startlevel; + startlevel =2 - sl0; }else {/* 16KB or 64KB pages */ - level =3 - startlevel; + startlevel =3 - sl0; }/* Check that the starting level is valid. */ - ok =check_s2_mmu_setup (cpu, va_size ==64 , level, inputsize, stride); + ok =check_s2_mmu_setup (cpu, va_size ==64 , startlevel, + inputsize, stride);if (!ok) { -/* AArch64 reports these as level 0 faults. -* AArch32 reports these as level 1 faults. -*/ - level = va_size ==64 ?0 :1 ; fault_type = translation_fault; goto do_fault; } + level = startlevel; }/* Clear the vaddr bits which aren't part of the within-region address,
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 04/21] arm: virt: Add an abstract ARM virt machine type
In reply to Peter MaydellFrom: Wei Huang <[email protected]>
In preparation for future ARM virt machine types, this patch creates an abstract type for all ARM machines. The current machine type in QEMU (i.e. "virt") is renamed to "virt-2.6", whose naming scheme is similar to other architectures. For the purpose of backward compatibility, "virt" is converted to an alias, pointing to "virt-2.6". With this patch, "qemu -M ?" lists the following virtual machine types along with others:
virt QEMU 2.6 ARM Virtual Machine (alias of virt-2.6)
virt-2.6 QEMU 2.6 ARM Virtual Machine
Message-id: [email protected]
--- hw/arm/virt.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
hw/arm/virt.c +18 -5
@@ -1345,6 +1345,19 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp) } } +static void virt_machine_class_init (ObjectClass *oc,void *data) +{ +} + +static const TypeInfo virt_machine_info = { + .name =TYPE_VIRT_MACHINE , + .parent =TYPE_MACHINE , + .abstract = true, + .instance_size =sizeof (VirtMachineState), + .class_size =sizeof (VirtMachineClass), + .class_init = virt_machine_class_init, +}; +static void virt_instance_init (Object *obj) {VirtMachineState *vms =VIRT_MACHINE (obj);
@@ -1382,7 +1395,8 @@ static void virt_class_init(ObjectClass *oc, void *data) {MachineClass *mc =MACHINE_CLASS (oc); - mc->desc ="ARM Virtual Machine" , + mc->desc ="QEMU 2.6 ARM Virtual Machine" ; + mc->alias ="virt" ; mc->init = machvirt_init;/* Start max_cpus at the maximum QEMU supports. We'll further restrict * it later in machvirt_init, where we have more information about the
@@ -1396,16 +1410,15 @@ static void virt_class_init(ObjectClass *oc, void *data) }static const TypeInfo machvirt_info = { - .name =TYPE_VIRT_MACHINE , - .parent =TYPE_MACHINE , - .instance_size =sizeof (VirtMachineState), + .name =MACHINE_TYPE_NAME ("virt-2.6" ), + .parent =TYPE_VIRT_MACHINE , .instance_init = virt_instance_init, - .class_size =sizeof (VirtMachineClass), .class_init = virt_class_init, };static void machvirt_machine_init (void ) { +type_register_static (&virt_machine_info);type_register_static (&machvirt_info); }
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 17/21] bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block
In reply to Peter MaydellFrom: Andrew Baumann <[email protected]>
At present only the core UART functions (data path for tx/rx) are implemented, which is enough for UEFI to boot. The following features/registers are unimplemented:
* Line/modem control
* Scratch register
* Extra control
* Baudrate
* SPI interfaces
Message-id: [email protected]
--- hw/arm/bcm2835_peripherals.c | 32 ++++ hw/char/Makefile.objs | 1 + hw/char/bcm2835_aux.c | 316 +++++++++++++++++++++++++++++++++++ include/hw/arm/bcm2835_peripherals.h | 2 + include/hw/char/bcm2835_aux.h | 33 ++++ 5 files changed, 384 insertions(+) create mode 100644 hw/char/bcm2835_aux.c create mode 100644 include/hw/char/bcm2835_aux.h
hw/arm/bcm2835_peripherals.c +32 -0
@@ -12,6 +12,7 @@#include "hw/arm/bcm2835_peripherals.h" #include "hw/misc/bcm2835_mbox_defs.h" #include "hw/arm/raspi_platform.h" +#include "sysemu/char.h" /* Peripheral base address on the VC (GPU) system bus */ #define BCM2835_VC_PERI_BASE 0x7e000000
@@ -48,6 +49,11 @@ static void bcm2835_peripherals_init(Object *obj)object_property_add_child (obj,"uart0" ,OBJECT (s->uart0),NULL );qdev_set_parent_bus (DEVICE (s->uart0),sysbus_get_default ()); +/* AUX / UART1 */ +object_initialize (&s->aux,sizeof (s->aux),TYPE_BCM2835_AUX ); +object_property_add_child (obj,"aux" ,OBJECT (&s->aux),NULL ); +qdev_set_parent_bus (DEVICE (&s->aux),sysbus_get_default ()); +/* Mailboxes */ object_initialize (&s->mboxes,sizeof (s->mboxes),TYPE_BCM2835_MBOX );object_property_add_child (obj,"mbox" ,OBJECT (&s->mboxes),NULL );
@@ -79,6 +85,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)MemoryRegion *ram;Error *err =NULL ;uint32_t ram_size; +CharDriverState *chr;int n; obj =object_property_get_link (OBJECT (dev),"ram" , &err);
@@ -131,6 +138,29 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)qdev_get_gpio_in_named (DEVICE (&s->ic),BCM2835_IC_GPU_IRQ , INTERRUPT_UART)); +/* AUX / UART1 */ +/* TODO: don't call qemu_char_get_next_serial() here, instead set +* chardev properties for each uart at the board level, once pl011 +* (uart0) has been updated to avoid qemu_char_get_next_serial() +*/ + chr =qemu_char_get_next_serial (); +if (chr ==NULL ) { + chr =qemu_chr_new ("bcm2835.uart1" ,"null" ,NULL ); + } +qdev_prop_set_chr (DEVICE (&s->aux),"chardev" , chr); + +object_property_set_bool (OBJECT (&s->aux), true,"realized" , &err); +if (err) { +error_propagate (errp, err); +return ; + } + +memory_region_add_subregion (&s->peri_mr,UART1_OFFSET , +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->aux),0 )); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->aux),0 , +qdev_get_gpio_in_named (DEVICE (&s->ic),BCM2835_IC_GPU_IRQ , +INTERRUPT_AUX )); +/* Mailboxes */ object_property_set_bool (OBJECT (&s->mboxes), true,"realized" , &err);if (err) {
@@ -203,6 +233,8 @@ static void bcm2835_peripherals_class_init(ObjectClass *oc, void *data)DeviceClass *dc =DEVICE_CLASS (oc); dc->realize = bcm2835_peripherals_realize; +/* Reason: realize() method uses qemu_char_get_next_serial() */ + dc->cannot_instantiate_with_device_add_yet = true; }static const TypeInfo bcm2835_peripherals_type_info = {
hw/char/Makefile.objs +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_SH4) += sh_serial.o obj-$(CONFIG_PSERIES) += spapr_vty.o obj-$(CONFIG_DIGIC) += digic-uart.o obj-$(CONFIG_STM32F2XX_USART) += stm32f2xx_usart.o +obj-$(CONFIG_RASPI) += bcm2835_aux.o common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o common-obj-$(CONFIG_ISA_DEBUG) += debugcon.o
hw/char/bcm2835_aux.c new file +316 -0
316 lines not on this page · raw message
include/hw/arm/bcm2835_peripherals.h +2 -0
@@ -14,6 +14,7 @@#include "qemu-common.h" #include "exec/address-spaces.h" #include "hw/sysbus.h" +#include "hw/char/bcm2835_aux.h" #include "hw/intc/bcm2835_ic.h" #include "hw/misc/bcm2835_property.h" #include "hw/misc/bcm2835_mbox.h"
@@ -33,6 +34,7 @@ typedef struct BCM2835PeripheralState {qemu_irq irq, fiq;SysBusDevice *uart0; +BCM2835AuxState aux;BCM2835ICState ic;BCM2835PropertyState property;BCM2835MboxState mboxes;
include/hw/char/bcm2835_aux.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft +* Written by Andrew Baumann +* +* This code is licensed under the GNU GPLv2 and later. +*/ + +#ifndef BCM2835_AUX_H +#define BCM2835_AUX_H + +#include "hw/sysbus.h" +#include "sysemu/char.h" + +#define TYPE_BCM2835_AUX "bcm2835-aux" +#define BCM2835_AUX (obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX) + +#define BCM2835_AUX_RX_FIFO_LEN 8 + +typedef struct { +/*< private >*/ +SysBusDevice parent_obj; +/*< public >*/ + +MemoryRegion iomem; +CharDriverState *chr; +qemu_irq irq; + +uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN ]; +uint8_t read_pos, read_count; +uint8_t ier, iir; +}BCM2835AuxState ; + +#endif
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 19/21] bcm2835_property: implement framebuffer control/configuration properties
In reply to Peter MaydellFrom: Grégory ESTRADE <[email protected]>
The property channel driver now interfaces with the framebuffer device to query and set framebuffer parameters. As a result of this, the "get ARM RAM size" query now correctly returns the video RAM base address (not total RAM size), and the ram-size property is no longer relevant here.
Message-id: [email protected]
--- hw/arm/bcm2835_peripherals.c | 8 +-- hw/arm/raspi.c | 7 +- hw/misc/bcm2835_property.c | 139 ++++++++++++++++++++++++++++++++++++- include/hw/misc/bcm2835_property.h | 5 +- 4 files changed, 144 insertions(+), 15 deletions(-)
hw/arm/bcm2835_peripherals.c +2 -6
@@ -79,6 +79,8 @@ static void bcm2835_peripherals_init(Object *obj) "board-rev", &error_abort);qdev_set_parent_bus (DEVICE (&s->property),sysbus_get_default ()); +object_property_add_const_link (OBJECT (&s->property),"fb" , +OBJECT (&s->fb), &error_abort);object_property_add_const_link (OBJECT (&s->property),"dma-mr" ,OBJECT (&s->gpu_bus_mr), &error_abort);
@@ -211,12 +213,6 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB));/* Property channel */ -object_property_set_int (OBJECT (&s->property), ram_size,"ram-size" , &err); -if (err) { -error_propagate (errp, err); -return ; - } -object_property_set_bool (OBJECT (&s->property), true,"realized" , &err);if (err) {error_propagate (errp, err);
hw/arm/raspi.c +1 -6
@@ -164,11 +164,6 @@ static void raspi2_machine_init(MachineClass *mc) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->max_cpus =BCM2836_NCPUS ; - -/* XXX: Temporary restriction in RAM size from the full 1GB. Since -* we do not yet support the framebuffer / GPU, we need to limit -* RAM usable by the OS to sit below the peripherals. -*/ - mc->default_ram_size =0x3F000000 ;/* BCM2836_PERI_BASE */ + mc->default_ram_size =1024 *1024 *1024 ; };DEFINE_MACHINE ("raspi2" , raspi2_machine_init)
hw/misc/bcm2835_property.c +137 -2
175 lines not on this page · raw message
include/hw/misc/bcm2835_property.h +4 -1
@@ -9,6 +9,7 @@#include "hw/sysbus.h" #include "exec/address-spaces.h" #include "net/net.h" +#include "hw/display/bcm2835_fb.h" #define TYPE_BCM2835_PROPERTY "bcm2835-property"#define BCM2835_PROPERTY (obj) \
@@ -18,13 +19,15 @@ typedef struct {/*< private >*/ SysBusDevice busdev;/*< public >*/ +MemoryRegion *dma_mr;AddressSpace dma_as;MemoryRegion iomem;qemu_irq mbox_irq; +BCM2835FBState *fbdev; +MACAddr macaddr;uint32_t board_rev; -uint32_t ram_size;uint32_t addr;bool pending; } BCM2835PropertyState;
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 02/21] target-arm: Implement MRS (banked) and MSR (banked) instructions
In reply to Peter MaydellStarting with the ARMv7 Virtualization Extensions, the A32 and T32 instruction sets provide instructions "MSR (banked)" and "MRS (banked)" which can be used to access registers for a mode other than the current one:
* R<m>_<mode>
* ELR_hyp
* SPSR_<mode>
Implement the missing instructions.
Message-id: [email protected]
--- target-arm/helper.h | 3 + target-arm/op_helper.c | 120 ++++++++++++++++++++++++ target-arm/translate.c | 246 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 366 insertions(+), 3 deletions(-)
target-arm/helper.h +3 -0
@@ -77,6 +77,9 @@ DEF_HELPER_1(exception_return, void, env) DEF_HELPER_2(get_r13_banked, i32, env, i32) DEF_HELPER_3(set_r13_banked, void, env, i32, i32) +DEF_HELPER_3(mrs_banked, i32, env, i32, i32) +DEF_HELPER_4(msr_banked, void, env, i32, i32, i32) + DEF_HELPER_2(get_user_reg, i32, env, i32)DEF_HELPER_3 (set_user_reg, void, env, i32, i32)
target-arm/op_helper.c +120 -0
126 lines not on this page · raw message
target-arm/translate.c +243 -3
276 lines not on this page · raw message
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 18/21] bcm2835_fb: add framebuffer device for Raspberry Pi
In reply to Peter MaydellFrom: Grégory ESTRADE <[email protected]>
The framebuffer occupies the upper portion of memory (64MiB by default), but it can only be controlled/configured via a system mailbox or property channel (to be added by a subsequent patch).
Message-id: [email protected]
--- hw/arm/bcm2835_peripherals.c | 38 +++- hw/arm/bcm2836.c | 2 + hw/arm/raspi.c | 5 +- hw/display/Makefile.objs | 1 + hw/display/bcm2835_fb.c | 424 +++++++++++++++++++++++++++++++++++ include/hw/arm/bcm2835_peripherals.h | 2 + include/hw/display/bcm2835_fb.h | 47 ++++ 7 files changed, 517 insertions(+), 2 deletions(-) create mode 100644 hw/display/bcm2835_fb.c create mode 100644 include/hw/display/bcm2835_fb.h
hw/arm/bcm2835_peripherals.c +37 -1
@@ -62,6 +62,16 @@ static void bcm2835_peripherals_init(Object *obj)object_property_add_const_link (OBJECT (&s->mboxes),"mbox-mr" ,OBJECT (&s->mbox_mr), &error_abort); +/* Framebuffer */ +object_initialize (&s->fb,sizeof (s->fb),TYPE_BCM2835_FB ); +object_property_add_child (obj,"fb" ,OBJECT (&s->fb),NULL ); +object_property_add_alias (obj,"vcram-size" ,OBJECT (&s->fb),"vcram-size" , + &error_abort); +qdev_set_parent_bus (DEVICE (&s->fb),sysbus_get_default ()); + +object_property_add_const_link (OBJECT (&s->fb),"dma-mr" , +OBJECT (&s->gpu_bus_mr), &error_abort); +/* Property channel */ object_initialize (&s->property,sizeof (s->property),TYPE_BCM2835_PROPERTY );object_property_add_child (obj,"property" ,OBJECT (&s->property),NULL );
@@ -84,7 +94,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)Object *obj;MemoryRegion *ram;Error *err =NULL ; -uint32_t ram_size; +uint32_t ram_size, vcram_size;CharDriverState *chr;int n;
@@ -174,6 +184,32 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)qdev_get_gpio_in_named (DEVICE (&s->ic),BCM2835_IC_ARM_IRQ , INTERRUPT_ARM_MAILBOX)); +/* Framebuffer */ + vcram_size = (uint32_t )object_property_get_int (OBJECT (s),"vcram-size" , + &err); +if (err) { +error_propagate (errp, err); +return ; + } + +object_property_set_int (OBJECT (&s->fb), ram_size - vcram_size, +"vcram-base" , &err); +if (err) { +error_propagate (errp, err); +return ; + } + +object_property_set_bool (OBJECT (&s->fb), true,"realized" , &err); +if (err) { +error_propagate (errp, err); +return ; + } + +memory_region_add_subregion (&s->mbox_mr,MBOX_CHAN_FB <<MBOX_AS_CHAN_SHIFT , +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->fb),0 )); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->fb),0 , +qdev_get_gpio_in (DEVICE (&s->mboxes),MBOX_CHAN_FB )); +/* Property channel */ object_property_set_int (OBJECT (&s->property), ram_size,"ram-size" , &err);if (err) {
hw/arm/bcm2836.c +2 -0
@@ -42,6 +42,8 @@ static void bcm2836_init(Object *obj) &error_abort);object_property_add_alias (obj,"board-rev" ,OBJECT (&s->peripherals),"board-rev" , &error_abort); +object_property_add_alias (obj,"vcram-size" ,OBJECT (&s->peripherals), +"vcram-size" , &error_abort);qdev_set_parent_bus (DEVICE (&s->peripherals),sysbus_get_default ()); }
hw/arm/raspi.c +4 -1
@@ -113,6 +113,7 @@ static void setup_boot(MachineState *machine, int version, size_t ram_size)static void raspi2_init (MachineState *machine) {RasPiState *s =g_new0 (RasPiState,1 ); +uint32_t vcram_size;DriveInfo *di;BlockBackend *blk;BusState *bus;
@@ -149,7 +150,9 @@ static void raspi2_init(MachineState *machine)qdev_prop_set_drive (carddev,"drive" , blk, &error_fatal);object_property_set_bool (OBJECT (carddev), true,"realized" , &error_fatal); -setup_boot (machine,2 , machine->ram_size); + vcram_size =object_property_get_int (OBJECT (&s->soc),"vcram-size" , + &error_abort); +setup_boot (machine,2 , machine->ram_size - vcram_size); }static void raspi2_machine_init (MachineClass *mc)
hw/display/Makefile.objs +1 -0
@@ -27,6 +27,7 @@ endif obj-$(CONFIG_OMAP) += omap_dss.o obj-$(CONFIG_OMAP) += omap_lcdc.o obj-$(CONFIG_PXA2XX) += pxa2xx_lcd.o +obj-$(CONFIG_RASPI) += bcm2835_fb.o obj-$(CONFIG_SM501) += sm501.o obj-$(CONFIG_TCX) += tcx.o obj-$(CONFIG_CG3) += cg3.o
hw/display/bcm2835_fb.c new file +424 -0
424 lines not on this page · raw message
include/hw/arm/bcm2835_peripherals.h +2 -0
@@ -15,6 +15,7 @@#include "exec/address-spaces.h" #include "hw/sysbus.h" #include "hw/char/bcm2835_aux.h" +#include "hw/display/bcm2835_fb.h" #include "hw/intc/bcm2835_ic.h" #include "hw/misc/bcm2835_property.h" #include "hw/misc/bcm2835_mbox.h"
@@ -35,6 +36,7 @@ typedef struct BCM2835PeripheralState {SysBusDevice *uart0;BCM2835AuxState aux; +BCM2835FBState fb;BCM2835ICState ic;BCM2835PropertyState property;BCM2835MboxState mboxes;
include/hw/display/bcm2835_fb.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 12/21] hw/timer: Add ASPEED timer device model
In reply to Peter MaydellFrom: Andrew Jeffery <[email protected]>
Implement basic ASPEED timer functionality for the AST2400 SoC[1]: Up to 8 timers can independently be configured, enabled, reset and disabled. Some hardware features are not implemented, namely clock value matching and pulse generation, but the implementation is enough to boot the Linux kernel configured with aspeed_defconfig.
[1] http://www.aspeedtech.com/products.php?fPath=20&rId=376
Message-id: [email protected]
--- default-configs/arm-softmmu.mak | 1 + hw/timer/Makefile.objs | 1 + hw/timer/aspeed_timer.c | 449 ++++++++++++++++++++++++++++++++++++++++ include/hw/timer/aspeed_timer.h | 59 ++++++ trace-events | 9 + 5 files changed, 519 insertions(+) create mode 100644 hw/timer/aspeed_timer.c create mode 100644 include/hw/timer/aspeed_timer.h
default-configs/arm-softmmu.mak +1 -0
@@ -110,3 +110,4 @@ CONFIG_IOH3420=y CONFIG_I82801B11=y CONFIG_ACPI=y CONFIG_SMBIOS=y +CONFIG_ASPEED_SOC=y
hw/timer/Makefile.objs +1 -0
@@ -32,3 +32,4 @@ obj-$(CONFIG_MC146818RTC) += mc146818rtc.o obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o +common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o
hw/timer/aspeed_timer.c new file +449 -0
449 lines not on this page · raw message
include/hw/timer/aspeed_timer.h new file +59 -0
59 lines not on this page · raw message
trace-events +9 -0
@@ -1892,3 +1892,12 @@ qio_channel_command_new_pid(void *ioc, int writefd, int readfd, int pid) "Comman qio_channel_command_new_spawn(void *ioc, const char *binary, int flags) "Command new spawn ioc=%p binary=%s flags=%d" qio_channel_command_abort(void *ioc, int pid) "Command abort ioc=%p pid=%d" qio_channel_command_wait(void *ioc, int pid, int ret, int status) "Command abort ioc=%p pid=%d ret=%d status=%d" + +# hw/timer/aspeed_timer.c +aspeed_timer_ctrl_enable(uint8_t i, bool enable) "Timer %" PRIu8 ": %d" +aspeed_timer_ctrl_external_clock(uint8_t i, bool enable) "Timer %" PRIu8 ": %d" +aspeed_timer_ctrl_overflow_interrupt(uint8_t i, bool enable) "Timer %" PRIu8 ": %d" +aspeed_timer_ctrl_pulse_enable(uint8_t i, bool enable) "Timer %" PRIu8 ": %d" +aspeed_timer_set_ctrl2(uint32_t value) "Value: 0x%" PRIx32 +aspeed_timer_set_value(int timer, int reg, uint32_t value) "Timer %d register %d: 0x%" PRIx32 +aspeed_timer_read(uint64_t offset, unsigned size, uint64_t value) "From 0x%" PRIx64 ": of size %u: 0x%" PRIx64
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 20/21] bcm2835_dma: add emulation of Raspberry Pi DMA controller
In reply to Peter MaydellFrom: Grégory ESTRADE <[email protected]>
At present, all DMA transfers complete inline (so a looping descriptor queue will lock up the device). We also do not model pause/abort, arbitrarion/priority, or debug features.
Message-id: [email protected]
--- hw/arm/bcm2835_peripherals.c | 26 +++ hw/dma/Makefile.objs | 1 + hw/dma/bcm2835_dma.c | 408 +++++++++++++++++++++++++++++++++++ include/hw/arm/bcm2835_peripherals.h | 2 + include/hw/dma/bcm2835_dma.h | 47 ++++ 5 files changed, 484 insertions(+) create mode 100644 hw/dma/bcm2835_dma.c create mode 100644 include/hw/dma/bcm2835_dma.h
hw/arm/bcm2835_peripherals.c +26 -0
@@ -88,6 +88,14 @@ static void bcm2835_peripherals_init(Object *obj)object_initialize (&s->sdhci,sizeof (s->sdhci),TYPE_SYSBUS_SDHCI );object_property_add_child (obj,"sdhci" ,OBJECT (&s->sdhci),NULL );qdev_set_parent_bus (DEVICE (&s->sdhci),sysbus_get_default ()); + +/* DMA Channels */ +object_initialize (&s->dma,sizeof (s->dma),TYPE_BCM2835_DMA ); +object_property_add_child (obj,"dma" ,OBJECT (&s->dma),NULL ); +qdev_set_parent_bus (DEVICE (&s->dma),sysbus_get_default ()); + +object_property_add_const_link (OBJECT (&s->dma),"dma-mr" , +OBJECT (&s->gpu_bus_mr), &error_abort); }static void bcm2835_peripherals_realize (DeviceState *dev,Error **errp)
@@ -258,6 +266,24 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)return ; } +/* DMA Channels */ +object_property_set_bool (OBJECT (&s->dma), true,"realized" , &err); +if (err) { +error_propagate (errp, err); +return ; + } + +memory_region_add_subregion (&s->peri_mr,DMA_OFFSET , +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->dma),0 )); +memory_region_add_subregion (&s->peri_mr,DMA15_OFFSET , +sysbus_mmio_get_region (SYS_BUS_DEVICE (&s->dma),1 )); + +for (n =0 ; n <=12 ; n++) { +sysbus_connect_irq (SYS_BUS_DEVICE (&s->dma), n, +qdev_get_gpio_in_named (DEVICE (&s->ic), +BCM2835_IC_GPU_IRQ , +INTERRUPT_DMA0 + n)); + } }static void bcm2835_peripherals_class_init (ObjectClass *oc,void *data)
hw/dma/Makefile.objs +1 -0
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_SUN4M) += sun4m_iommu.o obj-$(CONFIG_OMAP) += omap_dma.o soc_dma.o obj-$(CONFIG_PXA2XX) += pxa2xx_dma.o +obj-$(CONFIG_RASPI) += bcm2835_dma.o
hw/dma/bcm2835_dma.c new file +408 -0
408 lines not on this page · raw message
include/hw/arm/bcm2835_peripherals.h +2 -0
@@ -16,6 +16,7 @@#include "hw/sysbus.h" #include "hw/char/bcm2835_aux.h" #include "hw/display/bcm2835_fb.h" +#include "hw/dma/bcm2835_dma.h" #include "hw/intc/bcm2835_ic.h" #include "hw/misc/bcm2835_property.h" #include "hw/misc/bcm2835_mbox.h"
@@ -37,6 +38,7 @@ typedef struct BCM2835PeripheralState {SysBusDevice *uart0;BCM2835AuxState aux;BCM2835FBState fb; +BCM2835DMAState dma;BCM2835ICState ic;BCM2835PropertyState property;BCM2835MboxState mboxes;
include/hw/dma/bcm2835_dma.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 13/21] hw/intc: Add (new) ASPEED VIC device model
In reply to Peter MaydellFrom: Andrew Jeffery <[email protected]>
Implement a basic ASPEED VIC device model for the AST2400 SoC[1], with enough functionality to boot an aspeed_defconfig Linux kernel. The model implements the 'new' (revised) register set: While the hardware exposes both the new and legacy register sets, accesses to the model's legacy register set will not be serviced (however the access will be logged).
[1] http://www.aspeedtech.com/products.php?fPath=20&rId=376
Message-id: [email protected]
--- hw/intc/Makefile.objs | 1 + hw/intc/aspeed_vic.c | 339 +++++++++++++++++++++++++++++++++++++++++++ include/hw/intc/aspeed_vic.h | 48 ++++++ trace-events | 7 + 4 files changed, 395 insertions(+) create mode 100644 hw/intc/aspeed_vic.c create mode 100644 include/hw/intc/aspeed_vic.h
hw/intc/Makefile.objs +1 -0
@@ -31,3 +31,4 @@ obj-$(CONFIG_XICS_KVM) += xics_kvm.o obj-$(CONFIG_ALLWINNER_A10_PIC) += allwinner-a10-pic.o obj-$(CONFIG_S390_FLIC) += s390_flic.o obj-$(CONFIG_S390_FLIC_KVM) += s390_flic_kvm.o +obj-$(CONFIG_ASPEED_SOC) += aspeed_vic.o
hw/intc/aspeed_vic.c new file +339 -0
339 lines not on this page · raw message
include/hw/intc/aspeed_vic.h new file +48 -0
48 lines not on this page · raw message
trace-events +7 -0
@@ -1901,3 +1901,10 @@ aspeed_timer_ctrl_pulse_enable(uint8_t i, bool enable) "Timer %" PRIu8 ": %d" aspeed_timer_set_ctrl2(uint32_t value) "Value: 0x%" PRIx32 aspeed_timer_set_value(int timer, int reg, uint32_t value) "Timer %d register %d: 0x%" PRIx32 aspeed_timer_read(uint64_t offset, unsigned size, uint64_t value) "From 0x%" PRIx64 ": of size %u: 0x%" PRIx64 + +# hw/intc/aspeed_vic.c +aspeed_vic_set_irq(int irq, int level) "Enabling IRQ %d: %d" +aspeed_vic_update_fiq(int flags) "Raising FIQ: %d" +aspeed_vic_update_irq(int flags) "Raising IRQ: %d" +aspeed_vic_read(uint64_t offset, unsigned size, uint32_t value) "From 0x%" PRIx64 " of size %u: 0x%" PRIx32 +aspeed_vic_write(uint64_t offset, unsigned size, uint32_t data) "To 0x%" PRIx64 " of size %u: 0x%" PRIx32
Signature · 1 line
1.9.1
[Qemu-devel] [PULL 10/21] i.MX: Add i.MX6 CCM and ANALOG device.
In reply to Peter MaydellFrom: Jean-Christophe Dubois <[email protected]>
Message-id: 9fa80b4d8c5d0f50c94e77d74f952a7a665e168f.1456868959.git.jcd@tribudubois.net
--- hw/misc/Makefile.objs | 1 + hw/misc/imx6_ccm.c | 774 +++++++++++++++++++++++++++++++++++++++++++++ include/hw/misc/imx6_ccm.h | 197 ++++++++++++ 3 files changed, 972 insertions(+) create mode 100644 hw/misc/imx6_ccm.c create mode 100644 include/hw/misc/imx6_ccm.h
hw/misc/Makefile.objs +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_EXYNOS4) += exynos4210_pmu.o obj-$(CONFIG_IMX) += imx_ccm.o obj-$(CONFIG_IMX) += imx31_ccm.o obj-$(CONFIG_IMX) += imx25_ccm.o +obj-$(CONFIG_IMX) += imx6_ccm.o obj-$(CONFIG_MILKYMIST) += milkymist-hpdmc.o obj-$(CONFIG_MILKYMIST) += milkymist-pfpu.o obj-$(CONFIG_MAINSTONE) += mst_fpga.o
hw/misc/imx6_ccm.c new file +774 -0
774 lines not on this page · raw message
include/hw/misc/imx6_ccm.h new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 23 lines · Peter Maydell
Here's the target-arm queue; I'm a bit hesitant about the late-landing various new board/SoC patches, but they won't affect anybody who isn't trying to use those boards, so I think it's OK.
(There are a few other patches on list which I definitely want to get in before rc0 but they need a bit more review time I think.)
thanks
-- PMMThe following changes since commit
0ebc03bc065329eaefb6493f5fa7df08df528f2a:
util/base64.c: Clean includes (2016-03-16 12:48:11 +0000)are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.gittags/pull-target-arm-20160316for you to fetch changes up to
10b27d1ab391dbf36f92e1a33179662082401d7a:sd: Fix "info qtree" on boards with SD cards (2016-03-16 17:12:46 +0000)
Quoted 9 lines
----------------------------------------------------------------
target-arm queue:
* loader: Fix incorrect parameter name inload_image_mr()
* Implement MRS (banked) and MSR (banked) instructions
* virt: Implement versioning for machine model
* i.MX: some initial patches preparing for i.MX6 support
* new ASPEED AST2400 SoC and palmetto-bmc machine
* bcm2835: add some more raspi2 devices
* sd: fix segfault running "info qtree"
Some versions of gcc appear to give false positive 'may be used uninitialized' warnings about the msr/mrs code:
/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c: In function ‘gen_msr_banked
.isra.45’:/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c:4321:17:
error: ‘tgtmode’ ma
y be used uninitialized in this function [-Werror=maybe-uninitialized]
tcg_tgtmode = tcg_const_i32(tgtmode);
^
/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c:4322:15:
error: ‘regno’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
tcg_regno = tcg_const_i32(regno);
^/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c: In function ‘gen_mrs_banked.isra.48’:/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c:4343:17:
error: ‘tgtmode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
tcg_tgtmode = tcg_const_i32(tgtmode);
^
/home/petmay01/linaro/qemu-for-merges/target-arm/translate.c:4344:15:
error: ‘regno’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
tcg_regno = tcg_const_i32(regno);
^Fixup:
target-arm/translate.c +1 -1
@@ -4308,7 +4308,7 @@ undef:static void gen_msr_banked (DisasContext *s,int r,int sysm,int rn) {TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno; -int tgtmode, regno; +int tgtmode =0 , regno =0 ;if (!msr_banked_access_decode (s, r, sysm, rn, &tgtmode, ®no)) {return ;
@@ -4330,7 +4330,7 @@ static void gen_msr_banked(DisasContext *s, int
r, int sysm, int rn)
static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn)
{
TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno;- int tgtmode, regno;
+ int tgtmode = 0, regno = 0;
if (!msr_banked_access_decode(s, r, sysm, rn, &tgtmode, ®no)) {
return;which I'll squash into the appropriate patch and respin.
thanks
-- PMM
Quoted 15 lines · Peter Maydell
Here's the target-arm queue; I'm a bit hesitant about the late-landing various new board/SoC patches, but they won't affect anybody who isn't trying to use those boards, so I think it's OK.
(There are a few other patches on list which I definitely want to get in before rc0 but they need a bit more review time I think.)
thanks
-- PMMThe following changes since commit
0ebc03bc065329eaefb6493f5fa7df08df528f2a:
util/base64.c: Clean includes (2016-03-16 12:48:11 +0000)
Quoted 7 lines
are available in the git repository at:
git://git.linaro.org/people/pmaydell/qemu-arm.gittags/pull-target-arm-20160316for you to fetch changes up to
10b27d1ab391dbf36f92e1a33179662082401d7a:sd: Fix "info qtree" on boards with SD cards (2016-03-16 17:12:46 +0000)
Respin with fix now applied to master.
-- PMM