====== DDR Clock Adjustment ====== * [[en:c2_adjust_ddrclk#brief_ddr_spec_of_odroid-c2_and_available_ddr_clock_sets|Brief DDR spec. of ODROID-C2 and available DDR clock sets ]] * [[en:c2_adjust_ddrclk#update_guide_1_for_ubuntu|Update Guide (1) for Ubuntu ]] * [[en:c2_adjust_ddrclk#update_guide_2_for_android|Update Guide (2) for Android]] * [[en:c2_adjust_ddrclk#how_to_confirm_bl1_boot_with_the_new_ddr_clock_has_been_updated_well|How to confirm bl1 boot of the new DDR clock has been updated well]] ==== 1. Brief DDR spec. of ODROID-C2 and available DDR clock sets ==== * The DDR parts of C2 support max DDR3-1866 (CL - tRCD - tRP : 13-13-13) and the limit of max DDR clock is 933MHz based on DDR part spec. * Existing DDR clock and timing : 912MHz (912x2=1824) / 13-13-13 Here is the available DDR clock sets you can test. ^ DDR Clock ^ CL - tRCD - tRP ^ | 1104 MHz | 14-14-14 | | 912 MHz | 13-13-13 | | 792 MHz | 11-11-11 | | 408 MHz | 7-7-7 | Max ddr clock based on DDR parts of C2 is 933MHz. So, when you run with DDR clock 1104MHz, system stability can be unstable depends on ddr parts of each board, because it's over-clocking value so 1104MHz is not guaranteed for system stability. ==== 2. Update Guide (1) for Ubuntu ==== This section is for Ubuntu. First, download **c2_update_ddrclk.sh** to your root filesystem. $ wget https://dn.odroid.com/S905/BootLoader/ODROID-C2/c2_update_ddrclk.sh $ chmod +x ./c2_update_ddrclk.sh The usage of c2_update_ddrclk.sh is as following. Usage : ./c2_update_ddrclk.sh < DDR_CLK (1104 | 912 | 792 | 408) > After updating, you must run **reboot** the system. $ ./c2_update_ddrclk.sh 1104 $ reboot == c2_update_ddrclk.sh == Here is c2_update_ddrclk.sh. #!/bin/sh # # Copyright (C) 2016 Hardkernel Co,. Ltd # Joy Cho # # SPDX-License-Identifier: GPL-2.0+ # # update ddr clock for Ubuntu # if [ -z $1 ]; then echo "Usage ./c2_update_ddrclk.sh " exit 1 fi if [ $1 != 1104 -a $1 != 912 -a $1 != 792 -a $1 != 408 ]; then echo "Wrong DDRCLK! Usage ./c2_update_ddrclk.sh " exit 1 fi DDRCLK=$1 bl1=/tmp/bl1.bin.hardkernel.$DDRCLK tmp=/tmp/temp.bin ##### 1. check the current DDR clock #### dd if=/dev/mmcblk0 of=$tmp bs=1 count=2 skip=43530 status=none CUR_DDRCLK=$(hexdump -e '"%d"' $tmp) if [ $DDRCLK -eq $CUR_DDRCLK ]; then echo "current ddr clk is already set as $DDRCLK MHz" exit 1 fi echo "existing DDR clk is $CUR_DDRCLK" ##### 2. download bl1 binary from dn server #### wget -P /tmp/ http://dn.odroid.com/S905/BootLoader/ODROID-C2/bl1.bin.hardkernel.$DDRCLK if [ ! -f $bl1 ];then echo "error: bl1 binary doesn't exist" exit 1 fi dd if=$bl1 of=/dev/mmcblk0 bs=1 count=442 status=none dd if=$bl1 of=/dev/mmcblk0 bs=512 skip=1 seek=1 status=none echo "Update done!" ##### 3. check the updated DDR clock #### echo "Now let's check if update has been completed..." dd if=/dev/mmcblk0 of=$tmp bs=1 count=2 skip=43530 status=none CUR_DDRCLK=$(hexdump -e '"%d"' $tmp) echo "updated DDR clk is $CUR_DDRCLK" if [ $DDRCLK != $CUR_DDRCLK ]; then echo "updating DDR clock FAIL!! Expected : $DDRCLK, Updated : $CUR_DDRCLK" else echo "updating DDR clock has been completed!!!" fi rm $bl1 rm $tmp ==== 3. Update Guide (2) for Android ==== This section is for Android. Run Browser and open https://dn.odroid.com/S905/BootLoader/ODROID-C2/ {{:en:screenshot_20170630-135248.png?nolink|}} Download files. updatepackage-odroidc2-ddr-408.zip updatepackage-odroidc2-ddr-792.zip updatepackage-odroidc2-ddr-912.zip updatepackage-odroidc2-ddr-1104.zip Run ODROID Utility app. Click menu and Select "Package install from storage" {{:en:screenshot_20170630-134124.png?nolink|}} Select "File Manager" -> "Download" folder {{:en:screenshot_20170630-134134.png?nolink|}} Select updatepackage-odroidc2-ddr-xxx.zip wanted DDR clock. {{:en:screenshot_20170630-134141.png?nolink|}} Process "recovery" {{:en:screenshot_20170630-135845.png?nolink|}} current DDR clock. {{:en:screenshot_20170706-073355.png?nolink|}} ==== 4. How to confirm bl1 boot with the new DDR clock has been updated well ==== Wht the output message while updating with c2_update_ddrclk.sh, you can confirm if update is done with the new DDR clock you choose as following. $ ./c2_update_ddrclk.sh 1104 existing DDR clk is 912 <<<------ ..... ..... Update done! Now let's check if update has been completed... updated DDR clk is 1104 <<<------ updating DDR clock has been completed!!! After reboot, you can check the DDR configuration using the following logs of boot loader if you have a usb-uart module kit. BL2 Built : 11:44:26, Nov 25 2015. Board ID = 8 set vcck to 1100 mv set vddee to 1070 mv CPU clk: 1536MHz DDR channel setting: DDR0 Rank0+1 same DDR0: 2048MB(auto) @ 912MHz(2T)-13