qca / open-ath9k-htc-firmware

The firmware for QCA AR7010/AR9271 802.11n USB NICs
Other
426 stars 181 forks source link

CPU CLK 200MHz? #165

Open WooDwayToneTion opened 3 years ago

WooDwayToneTion commented 3 years ago

Hi !Sorry to bother you.
I have some questions about this firmware. I‘ve got the data sheet of ar9271 . But I feel it doesn't match the source code to a certain extant. For example,some registers' name in the datasheet are different with this code .(And why there are source files prefixed with ar5416?)
Maybe because I'm a new hand , I didn't find something can tell me the background about this program after browsing the doc and wiki.

So,it is the most critical problem that I can't handle on my own : image image

I want to set the CPU clk to 40MHz but in your code it has been set to 200MHz. image

And I can't find the regitsters like 0x0005_6000 in the datasheet . image

image

I really appreciate if you can help me.

olerem commented 3 years ago

This firmware runs on two different SoCs:

The reason why this firmware has artifacts or names pointing to other SoCs is following:

WooDwayToneTion commented 3 years ago

Thank you so much! Maybe these convention and knowledge are ordinary to you firmware developers . BUT it is really important to us who just want to modified the firmware a little bit.

WooDwayToneTion commented 3 years ago

There are something I got still puzzled with:

As the function _change_magpieclk() in _athosmain.c I mentioned above , I want to know if it will really work with chip ar9271 , or I need to add some code with functions in k2 directory instead of magpie ?

olerem commented 3 years ago

I want to know if it will really work with chip ar9271

no

I need to add some code with functions in k2 directory instead of magpie

sboot is not part of compiled firmware. It is a reference code of boot loader.

You will probably wont to do it somewhere in target_firmware/magpie_fw_dev/target/init/app_start.c or target_firmware/magpie_fw_dev/target/init/init.c

WooDwayToneTion commented 3 years ago

Thanks!

rodrigowue commented 3 years ago

Hey! Pretty interesting discussion. I'm not sure if I got it right. So, if we want to change the frequency on the cpu we need to manipulate the sboot? @Skrrrrrrrrrrrr do you have any updates on this?

Cheers :)

WooDwayToneTion commented 3 years ago

Hey! Pretty interesting discussion. I'm not sure if I got it right. So, if we want to change the frequency on the cpu we need to manipulate the sboot? @Skrrrrrrrrrrrr do you have any updates on this?

Cheers :)

Sorry to reply to you not on time.

In fact , I'm going to modified this NIC to add some features. It is necessary to figure out how to write registers to control the workflow in the device. The modification of CPU_CLK is just a test, it is not the point of my program. So I didn't make any change to sboot.

WooDwayToneTion commented 3 years ago

@rodrigowue And maybe you should view the CMakeLists.txt in _targetfirmware . Then you will find out which files are compiled

sboot is not part of compiled firmware. It is a reference code of boot loader.

rodrigowue commented 3 years ago

Thanks a lot!