Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU CLK 200MHz? #165

Open
WooDwayToneTion opened this issue Nov 4, 2020 · 9 comments
Open

CPU CLK 200MHz? #165

WooDwayToneTion opened this issue Nov 4, 2020 · 9 comments

Comments

@WooDwayToneTion
Copy link

WooDwayToneTion commented Nov 4, 2020

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
Copy link
Contributor

olerem commented Nov 4, 2020

This firmware runs on two different SoCs:

  • ar9271 - code name k2
  • ar7010 - code name magpie

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

  • most company prefer to save resources so they develop one firmware/driver for many chips
  • this FW is historically grown from BSD source code

@WooDwayToneTion
Copy link
Author

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
Copy link
Author

WooDwayToneTion commented Nov 4, 2020

There are something I got still puzzled with:

As the function change_magpie_clk() in athos_main.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
Copy link
Contributor

olerem commented Nov 4, 2020

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
Copy link
Author

Thanks!

@rodrigowue
Copy link

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
Copy link
Author

WooDwayToneTion commented Dec 8, 2020

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
Copy link
Author

WooDwayToneTion commented Dec 8, 2020

@rodrigowue
And maybe you should view the CMakeLists.txt in target_firmware . 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
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants