Add support for new device

Hi,

I would like to add support for a new hardware. I followed this documentation. I searched through commits to see the recent support added for devices. I got some basic idea how to start but I am having lots of difficulty to proceed further. The most difficult part is writing mach-device.c file. I didn't find any documentation for the functions used in this file. It would be great if someone guide me to the right direction and help me how should I start and what should be the starting point?

Device Specifications:

  • Atheros AR71xx
  • 64 MB of RAM
  • 16 MB of Flash
  • 1T1R 2.4 Wlan
  • 2x 10/100 Mbps Ethernet
  • 3x LEDs, 1x gpio button
  • 1x USB 2.0, 5V
  • UART over usb

Use the DTS-based ath79 platform. The ar71xx platform is deprecated.

No “magic” to getting the DTS, just some detective work, trial and error, and a bit of luck.

1 Like

Well that's other way, but still need to understand what is going under the hood.

Lots of references I found useful linked on https://openwrt.org/docs/guide-developer/defining-firmware-partitions

(Page content is DTS, in general now, not just partitions)

Start by giving that anonymous device a name.
It certainly has a manufacturer and a model printed on the case somewhere.

1 Like

It's new device designed by our team. It's hardware details are similar to Carambola2.

Then you should start with this:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=64493d42b41253aafe1538e325e0692db4201046;hp=046263095e007ba80bdf3525de32d7cce11734e8

ath79: add support for 8devices Carambola2 development board

Specifications:
- Atheros AR9331 (400 MHz)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 1T1R 2.4 Wlan (AR9331)
- 2x 10/100 Mbps Ethernet
- 3x LEDs, 1x gpio button
- 1x USB 2.0, 5V
- UART over usb, 115200n8

You should just duplicate that (and the possible later commits for the device). If you have deviated from that in your hardware / bootloader design, just modify the hardware definition in DTS accordingly.

You may also see interesting generic DTS discussion in Porting guide ar71xx to ath79? thread.

Will give it a shot and try to decipher the terms in dts file.