From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 12 Jan 2012 15:05:05 -0800 Subject: [U-Boot] [PATCH 13/14] tegra: Add EMC settings for Seaboard, Harmony In-Reply-To: <4F0C879E.1040504@nvidia.com> References: <1324927987-13100-1-git-send-email-sjg@chromium.org> <1324927987-13100-14-git-send-email-sjg@chromium.org> <4F0C879E.1040504@nvidia.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stephen, On Tue, Jan 10, 2012 at 10:46 AM, Stephen Warren wrote: > On 12/26/2011 12:33 PM, Simon Glass wrote: >> From: Jimmy Zhang >> >> Set Seaboard and Harmony to optimal memory settings based on the SOC >> in use (T20 or T25). >> >> Signed-off-by: Simon Glass > >> diff --git a/board/nvidia/common/emc.c b/board/nvidia/common/emc.c > ... >> +static const struct tegra_emc_table seaboard_emc_tables_hynix_333Mhz[] = { > ... >> +static const struct tegra_emc_table seaboard_emc_tables_hynix_380Mhz[] = { > ... >> +void seaboard_emc_init(void) > ... >> +static struct emc_init board_table[] = { >> + ? ? ? { >> + ? ? ? ? ? ? ? .id ? ? = MACH_TYPE_HARMONY, >> + ? ? ? ? ? ? ? .init ? = NULL, >> + ? ? ? }, >> + ? ? ? { >> + ? ? ? ? ? ? ? .id ? ? = MACH_TYPE_SEABOARD, >> + ? ? ? ? ? ? ? .init ? = seaboard_emc_init, >> + ? ? ? }, >> +}; > > Why not just put the Seaboard-specific code into Seaboard's board > directory instead of a common location? Then you wouldn't need this > table at all, and boards other than Seaboard wouldn't be required to > carry the Seaboard EMC tables. I have moved this into the device tree. > There don't appear to be any tables for Harmony, which is inconsistent > with the commit description. Updated the commit description :-) > >> +int board_emc_init(void) >> +{ >> + ? ? ? int ? ? i; >> + ? ? ? DECLARE_GLOBAL_DATA_PTR; >> + >> +#ifdef CONFIG_TEGRA_PMU >> + ? ? ? /* if voltage has not been set properly, return */ >> + ? ? ? if (!pmu_is_voltage_nominal()) >> + ? ? ? ? ? ? ? return -1; >> +#endif > > Why/when would the PMU voltage not be nominal? On boot, it starts up lower and we raise it to nominal so we can run at full speed. > > Can't we error out the compile if the options that cause the PMU voltage > to be initialized to nominal are not set, instead of detecting this at > runtime? I don't think so, since we can't know in U-Boot what the start-up voltages are. > Finally, I don't think there are EMC tables here for all the EMC > frequencies that we have BCTs for. Perhaps that's not an issue, and > perhaps I should ignore the other BCTs (e.g. 400MHZ EMC) since nobody > actually uses them? Yes I think maximum speed is all anyone is probably interested in now. Regards, Simon > > -- > nvpublic