Blok | I was on my way to load a kernel when it struck me that I do not tell it what frequency the or1200 core is running on my platform. That kernel deduces the frequency from the timer (?), but what does the timer know. What is the right way of telling the timer/kernal what frequency the cpu is running? | 12:12 |
---|---|---|
Blok | Hello btw :) | 12:12 |
jonibo | you need specify the cpu frequency in the device tree description for your platform | 12:58 |
jonibo | usually you need to specify it in two places, because the uart wants to be told explicitly, too | 12:59 |
jonibo | see the example at arch/openrisc/boot/dts/or1ksim.dts | 12:59 |
jonibo | you can copy that file and modify it for your platform, then select your version by name in the kernel configuration | 13:00 |
Blok | Sorry about my ignorance. Just wondering. Will the bootloader supply the DT in the "general" case? | 13:01 |
jonibo | yes | 13:01 |
jonibo | that's the idea... the bootloader should pass the device tree (binary) to the kernel | 13:01 |
jonibo | but since you're probably running without a bootloader, then it's easiest to just build the device tree description into the kernel | 13:01 |
Blok | I am using ORPmon, but I cannot see that it supplies a dt | 13:02 |
jonibo | no, it doesn't | 13:02 |
jonibo | i think only u-boot (or barebox) does | 13:02 |
jonibo | stekern might be able to provide more info here | 13:03 |
Blok | I feel really stupid now becasue I missed the file.. | 13:03 |
jonibo | no worries, this is all pretty poorly documented | 13:03 |
Blok | Thanks a lot btw! | 13:03 |
Blok | Still a little confused. Will I get away with adding CONFIG_DEVICE_TREE? As I have no device tree now I am guessing it falls back to 25 MHz? | 13:09 |
jonibo | yeah, you should add the name of the .dts file that you want compiled into your kernel | 13:11 |
jonibo | falls back to 25 Mhz? not sure where that's coming from... | 13:11 |
jonibo | i think the kernel won't run at all without a device tree... | 13:11 |
Blok | I belive I caught it when I looked where the cpu freq is read from | 13:12 |
jonibo | for example, it won't know how much memory it has... that needs to go into the device tree, too | 13:12 |
Blok | sure | 13:12 |
jonibo | i don't think falling back to 25Mhz makes sense... sounds like a bug if that's what it's doing | 13:12 |
Blok | "of_property_read_u32 => Device tree missing CPU 'clock-frequency' parameter...Assuming frequency 25MHZ" in setup.c | 13:14 |
jonibo | hmmm... | 13:14 |
Blok | not "", just pasted together | 13:14 |
jonibo | i'd say that message is wrong... there's no 25Mhz assumption (at least, there isn't anymore, if there were was one) | 13:21 |
jonibo | in any case, if you don't have a device tree, the boot will fail before it gets to that point anyway | 13:21 |
jonibo | and the console output will be garbled so you'll never see that message :) | 13:22 |
Blok | I just saw that the file or1ksim.dts is used so pretty much everything except the clock is "almost" correct :) | 13:23 |
Blok | Now it looks good. Thanks a lot again! | 13:25 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!