mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 03:58:18 -04:00
powerpc/p4080: Fix warning in serdes code from early use of hwconfig
Hwconfig is called before relocating. Use the new hwconfig APIs. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
6b06d7dc07
commit
768d5b2baf
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Freescale Semiconductor, Inc.
|
* Copyright 2009-2011 Freescale Semiconductor, Inc.
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
* project.
|
* project.
|
||||||
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
static u32 serdes_prtcl_map;
|
static u32 serdes_prtcl_map;
|
||||||
|
|
||||||
|
#define HWCONFIG_BUFFER_SIZE 128
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static const char *serdes_prtcl_str[] = {
|
static const char *serdes_prtcl_str[] = {
|
||||||
[NONE] = "NA",
|
[NONE] = "NA",
|
||||||
@ -277,6 +279,15 @@ void fsl_serdes_init(void)
|
|||||||
const char *srds_lpd_arg;
|
const char *srds_lpd_arg;
|
||||||
size_t arglen;
|
size_t arglen;
|
||||||
#endif
|
#endif
|
||||||
|
char buffer[HWCONFIG_BUFFER_SIZE];
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extract hwconfig from environment since we have not properly setup
|
||||||
|
* the environment but need it for ddr config params
|
||||||
|
*/
|
||||||
|
if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
|
||||||
|
buf = buffer;
|
||||||
|
|
||||||
/* Is serdes enabled at all? */
|
/* Is serdes enabled at all? */
|
||||||
if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
|
if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
|
||||||
@ -295,8 +306,8 @@ void fsl_serdes_init(void)
|
|||||||
if (!IS_SVR_REV(get_svr(), 1, 0))
|
if (!IS_SVR_REV(get_svr(), 1, 0))
|
||||||
for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) {
|
for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) {
|
||||||
sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1);
|
sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1);
|
||||||
srds_lpd_arg = hwconfig_subarg("serdes", srds_lpd_opt,
|
srds_lpd_arg = hwconfig_subarg_f("serdes", srds_lpd_opt,
|
||||||
&arglen);
|
&arglen, buf);
|
||||||
if (srds_lpd_arg)
|
if (srds_lpd_arg)
|
||||||
srds_lpd_b[bank] = simple_strtoul(srds_lpd_arg,
|
srds_lpd_b[bank] = simple_strtoul(srds_lpd_arg,
|
||||||
NULL, 0);
|
NULL, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user