From 046cd824c150880c4a6e0588aa8ed0fd6f2f5973 Mon Sep 17 00:00:00 2001 From: Stefan Eichenberger Date: Thu, 11 Aug 2016 18:15:17 +0200 Subject: [PATCH] netbird: set V_OSCK to 0, this will autodetect the clock This patch uses the autodetection of the Oszillator frequency from sysboot1. --- board/nm/netbird/board.c | 5 ++++- include/configs/am335x_netbird.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/board/nm/netbird/board.c b/board/nm/netbird/board.c index e48a880df7..96789c4c33 100644 --- a/board/nm/netbird/board.c +++ b/board/nm/netbird/board.c @@ -127,7 +127,7 @@ int spl_start_uboot(void) #endif #define OSC (V_OSCK/1000000) -const struct dpll_params dpll_ddr_nbhw16= { +struct dpll_params dpll_ddr_nbhw16= { 400, OSC-1, 1, -1, -1, -1, -1}; void am33xx_spl_board_init(void) @@ -155,6 +155,7 @@ void am33xx_spl_board_init(void) const struct dpll_params *get_dpll_ddr_params(void) { + dpll_ddr_nbhw16.n = (get_osclk() / 1000000) - 1; return &dpll_ddr_nbhw16; } @@ -320,6 +321,8 @@ int board_init(void) #define SMA2_REGISTER (CTRL_BASE + 0x1320) writel(0x01, SMA2_REGISTER); /* Select RMII2_CRS_DV instead of MMC2_DAT7 */ + printf("OSC: %lu Hz\n", get_osclk()); + return 0; } diff --git a/include/configs/am335x_netbird.h b/include/configs/am335x_netbird.h index 10299b1b3d..2a5e2dd91d 100644 --- a/include/configs/am335x_netbird.h +++ b/include/configs/am335x_netbird.h @@ -35,7 +35,7 @@ #define CONFIG_BOARD_LATE_INIT /* Clock Defines */ -#define V_OSCK 24000000 /* Clock output from T2 */ +#define V_OSCK 0 /* 0 means detect from sysboot1 config */ #define V_SCLK (V_OSCK) #include