how to build QEMU with the peripheral device modules
Hi All,
I am trying to add a DMA peripheral module. In hw/dma directory, a file ti_dma.c is added. Also, in hw/dma/kconfig, I added the following lines:
config TI_DMA
bool
In hw/dma/makefile.ojb, added one line:
common-obj-$(CONFIG_TI_DMA) += ti_dma.o
However, ti_dma.c is not compiled as the QEMU project is built. Some directories(eg. block, cpu...) under hw will be compiled though. The makefile.obj seems to show that the DMA module would be built along with others:
devices-dirs-y = core/
ifeq ($(CONFIG_SOFTMMU), y)
devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/
devices-dirs-y += acpi/
devices-dirs-y += adc/
devices-dirs-y += audio/
devices-dirs-y += block/
devices-dirs-y += bt/
devices-dirs-y += char/
devices-dirs-y += cpu/
devices-dirs-y += display/
devices-dirs-y += dma/
devices-dirs-y += gpio/
......
I am not sure what is missing here. Any advise would be appreciated. Thanks.
xiaolei
Quoted 11 lines · casmac
Hi All,
I am trying to add a DMA peripheral module. In hw/dma directory, a fileti_dma.cis added. Also, in hw/dma/kconfig, I added the following lines:
configTI_DMA
bool
In hw/dma/makefile.ojb, added one line:
common-obj-$(CONFIG_TI_DMA) += ti_dma.o
How did you set CONFIG_TI_DMA?
You can add it to the configure script if it's orthogonal to everything else, or have it set as some default in a default config e.g. for whatever board you have, or add a Kconfig dependency.
Quoted 19 lines
However,
ti_dma.cis not compiled as the QEMU project is built. Some directories(eg. block, cpu...) under hw will be compiled though. The makefile.obj seems to show that the DMA module would be built along with others:
devices-dirs-y = core/
ifeq ($(CONFIG_SOFTMMU), y)
devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/
devices-dirs-y += acpi/
devices-dirs-y += adc/
devices-dirs-y += audio/
devices-dirs-y +=block/
devices-dirs-y += bt/
devices-dirs-y += char/
devices-dirs-y += cpu/
devices-dirs-y += display/
devices-dirs-y += dma/
devices-dirs-y += gpio/
......
I am not sure what is missing here. Any advise would be appreciated. Thanks.xiaolei
Hi,
Quoted 6 lines · casmac
Hi All,
  I am trying to add a DMA peripheral module. In hw/dma directory, a fileÂti_dma.cis added.
  Also, in hw/dma/kconfig, I added the following lines:
configTI_DMA
bool
You need some device that 'selects' your device.
You can select it by default:
config TI_DMA
bool
default y
You can enforce the selection on a target. For example to add it to all the ARM machines, in default-configs/arm-softmmu.mak add:
CONFIG_TI_DMA=y
The best is to only select it when required. For example if you need it on all machines using a TI OMAP SoC, then you'd select it in the OMAP section of hw/arm/Kconfig:
config OMAP
bool
select FRAMEBUFFER
select I2C
select ECC
select NAND
select PFLASH_CFI01
select SD
select SERIAL
select TI_DMA
You should have enough to adapt to your needs.
Regards,
Phil.
Quoted 25 lines
  In hw/dma/makefile.ojb, added one line:
common-obj-$(CONFIG_TI_DMA) += ti_dma.o
  However,ti_dma.cis not compiled as the QEMU project is built. Some directories(eg. block, cpu...) under hw will be compiled though.   The makefile.obj seems to show that the DMA module would be built along with others:
devices-dirs-y = core/
ifeq ($(CONFIG_SOFTMMU), y)
devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/
devices-dirs-y += acpi/
devices-dirs-y += adc/
devices-dirs-y += audio/
devices-dirs-y +=block/
devices-dirs-y += bt/
devices-dirs-y += char/
devices-dirs-y += cpu/
devices-dirs-y += display/
devices-dirs-y += dma/
devices-dirs-y += gpio/
......
  I am not sure what is missing here. Any advise would be appreciated. Thanks.xiaolei
Hi ,
Thanks for the hints. I get better understanding to the kconfig tool now. I added "select TI_DMA" in my DSP kconfig file. It is done.
best regards,
xiaolei
------------------ Original ------------------ From: "Philippe Mathieu-Daudé"<[email protected]>; Date: Fri, Jun 19, 2020 10:59 PM To: "casmac"<[email protected]>;"qemu-devel"<[email protected]>;
Subject: Re: how to build QEMU with the peripheral device modules
Hi,
On 6/19/20 3:24 PM, casmac wrote:
> Hi All,
>   I am trying to add a DMA peripheral module. In hw/dma directory, a > file ti_dma.c is added.
> Â Â Also, in hw/dma/kconfig, I added the following lines:
> config TI_DMA
> bool
You need some device that 'selects' your device.
You can select it by default:
config TI_DMA
bool
default y
You can enforce the selection on a target. For example to add it to all the ARM machines, in default-configs/arm-softmmu.mak add:
CONFIG_TI_DMA=y
The best is to only select it when required. For example if you need it on all machines using a TI OMAP SoC, then you'd select it in the OMAP section of hw/arm/Kconfig:
config OMAP bool select FRAMEBUFFER select I2C select ECC select NAND select PFLASH_CFI01 select SD select SERIAL select TI_DMA
You should have enough to adapt to your needs.
Regards,
Phil.
> Â Â In hw/dma/makefile.ojb, added one line:
> common-obj-$(CONFIG_TI_DMA) += ti_dma.o
>   However, ti_dma.c is not compiled as the QEMU project is built. Some > directories(eg. block, cpu...) under hw will be compiled though. >   The makefile.obj seems to show that the DMA module would be built > along with others:
> devices-dirs-y = core/
> ifeq ($(CONFIG_SOFTMMU), y)
> devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call
> land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/
> devices-dirs-y += acpi/
> devices-dirs-y += adc/
> devices-dirs-y += audio/
> devices-dirs-y += block/
> devices-dirs-y += bt/
> devices-dirs-y += char/
> devices-dirs-y += cpu/
> devices-dirs-y += display/
> devices-dirs-y += dma/
> devices-dirs-y += gpio/
> ......
> Â Â I am not sure what is missing here. Any advise would be appreciated. > Thanks.
>
> xiaolei