Hello All, I'm working on a new microcontroller target (Atmel ATSAM4E) for the qemu-system-arm executable. I've successfully setup a machine and created some peripherals. I have some questions about how to structure the files for contributing this target to the qemu project.
In the current "hw" directory, there seems to be a mashup of MCU/board machines, peripherals for these machines, and devices that would communicate with these peripherals like I2C or SPI slave devices. There are also general definitions for buses like I2C and SPI. There seem to be peripherals for certain machines spread over several different directories. For example, the omap*.c files are defined in the "arm" sub directory, and then several of the peripherals are defined in the ssi/i2c/gpio/etc directories. This seems inefficient from a development perspective because the omap i2c/ssi/gpio peripherals are unlikely to be reused by other MCUs or targets (except by derivatives in the OMAP family perhaps). My preferred way to contribute to the project would be to create a new set of directories in "hw/arm" that would have the following hierarchy: hw/arm/atmel/ - utils/ - atsam4/ - common/ <-- Common Peripherals in family - atsam4e/ <-- Machine and Peripheral Definitions - atsam4n/ ... - atsam3/ <-- Other families in the future? Similarly, I would create an "include" structure for headers: include/hw/arm/atmel/ - utils/ - atsam4/ - common/ - atsam4e/ - atsam4n/ ... - atsam3/ Is this reasonable and acceptable? I think refactoring the code in "hw" directory to organize machine targets using similar logic for SOCs and moving slave device targets into a separate subdirectory would be useful. I'm new to this project so perhaps I'm missing something. I hope this does not come across as stepping on anyones toes; that was not my intent. Thanks in advanced for any comments or advice.