1.) I've compiled my own kernels so I know how to use make menuconfig and hand edit the file it creates. I know that certain patches are necessary for certain devices, so was that a first step in getting the kernel working? Does Ingenic supply official patches? Is there already assembly code for MIPS in a standard kernel source distribution? Does any of this work with the Ingenic CPU?
Ingenic provides a kernel for their reference boards. The first Dingux kernel was made by booboo based on Ingenic's kernel. That started the whole Dingux scene.
If you're interested in learning I would rather recommend the OpenDingux kernel though. It is kept up to date (based on Linux 3.0 currently, as opposed to 184.108.40.206 for booboo's kernel) and the driver code is cleaner than Ingenic's, so easier to understand when you read it. See Building OpenDingux from sources
for a quick start in building OpenDingux.
Dingoo support is layered as follows:
First there is generic MIPS support, this has been part of the kernel for a long time. It resides in the arch/mips/ directory.
On top of that there is JZ4740 platform support in arch/mips/jz4740/ and drivers in drivers/ (grouped by subsystem rather than platform). In booboo's kernel this has been provided by Ingenic, in OpenDingux this has been provided by Lars-Peter Clausen and other people, who originally wrote it for Qi Hardware's Ben NanoNote mini computer which also uses the JZ4740 SoC. The NanoNote drivers are being merged into the mainline kernel: several have been merged already and others need cleanups before they can be merged.
Finally there is specific support for the Dingoo A320. This consist of a kernel config (arch/mips/configs/a320_defconfig), a board definition (arch/mips/jz4740/board_a320.c) and a few other files (check the git history).
2.) Drivers. Did you have to write drivers from scratch for the video, sound, buttons and such? Or did Dingoo or Ingenic supply these? Or, is the device using off-the-shelf stuff that already has drivers available? Were any drivers already included in the kernel source that worked with the Dingoo?
Most drivers already existed from Ingenic or the Ben NanoNote. Sometimes they needed fixing or adapting though to be useful on the Dingoo. Other drivers had to be written from scratch.
Things like the GPIO map and the LCD init sequence had to be reverse engineered. This was done by booboo; he documented the process on his blog
3.) How did you figure out how to flash the internal flash? Is the device using a standard interface for flashing? Does the internal flash hold the bootloader as well? Is there any documentation for this or did you have to figure it out by trial-and-error?
Most of it was discovered by booboo by reverse engineering. The earliest boot stage is documented by Ingenic, but the stages after that are not documented. You can learn more by reading booboo's blog and by checking out the OpenDingux board-a320.c, which contains the NAND partitioning. The jzboot tool can be useful in exploring the contents of the NAND, as well as for booting kernels via USB; you can build this tool as part of the xburst-tools package available from projects.qi-hardware.com.
Sorry if this seems overly demanding of you guys' time, but I am really excited about learning more about this device and writing some software for it!
Please visit #dingoonity on freenode IRC some time, a lot of developers, porters and users hang out there.