milkv-duo / duo-arduino

GNU Lesser General Public License v2.1
15 stars 8 forks source link

CPU Clock speed only 25MHz? #4

Closed kinsamanka closed 8 months ago

kinsamanka commented 8 months ago

Snippet of the compilation log:

...
Detecting libraries used...
"/home/temp/.arduino15/packages/sophgo/tools/xpack-riscv-none-elf-gcc/13.2.0-2/bin/riscv-none-elf-g++" -MMD -c -c "-I." "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/include" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/bsp/include" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/bsp/include/hal" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/bsp/include/csi" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/bsp/include/cvi" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x/bsp/include/hal/dw" -w -Os -D__riscv64 -mcmodel=medany -mabi=lp64d -march=rv64imfd_zicsr -w -x c++ -E -CC -DF_CPU=25000000L -DSTART_ADDR=0x83f40000 -DIMAGE_SIZE=0xc0000 -DARDUINO=10819 -DARDUINO_DUO_DEV -DARDUINO_ARCH_CV180X -DARDUINO_BOARD="DUO_DEV" -DARDUINO_VARIANT="duo" -DARDUINO_PARTITION_default  "-I/home/temp/Arduino/Blink" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/cores/cv180x" "-I/home/temp/.arduino15/packages/sophgo/hardware/CV180X/0.2.3/variants/duo"  "/tmp/arduino_build_664246/sketch/Blink.ino.cpp" -o "/dev/null"
...

CPU speed is defined by -DF_CPU=25000000L

Is there a way to increase the cpu clock speed to 700 MHz?

markbirss commented 8 months ago

i found same issue with duo-buildroot-sdk ?

https://github.com/milkv-duo/duo-buildroot-sdk/blob/f0d36b214a4e1659a4b6a0f8aa2d2c29ed236b86/build/boards/default/dts/cv180x_riscv/cv180x_base_riscv.dtsi#L52C1-L52C33

kinsamanka commented 8 months ago

It's not actually the cpu speed but rather the timebase frequency. :smiley:

see: https://github.com/torvalds/linux/blob/0dd3ee31125508cd67f7e7172247f05b7fd1753a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi#L16C3-L16C21

markbirss commented 8 months ago

@kinsamanka yes,

but also changing the dev-freqs values also have no effect

https://github.com/milkv-duo/duo-buildroot-sdk/blob/f0d36b214a4e1659a4b6a0f8aa2d2c29ed236b86/build/boards/default/dts/cv180x_riscv/cv180x_base_riscv.dtsi#L93C4-L95C26

kinsamanka commented 8 months ago

There is no driver for the cv180x_cooling dts entry, so changing the values doesn't have any effect.