mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 03:58:18 -04:00
powerpc/85xx: Fix warning for USB device-fixup
Fix USB device-fixup warning "node not found". This was occuring because of static nature of start_offset variable Static start_offset was storing offset of last node modified, and was becoming issue if node fixup is carried multiple times, resulting in "node not found" warning Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
72243c0194
commit
4765fb7d73
@ -87,13 +87,12 @@ void ft_fixup_num_cores(void *blob) {
|
|||||||
#endif /* defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) */
|
#endif /* defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) */
|
||||||
|
|
||||||
#ifdef CONFIG_HAS_FSL_DR_USB
|
#ifdef CONFIG_HAS_FSL_DR_USB
|
||||||
static void fdt_fixup_usb_mode_phy_type(void *blob, const char *mode,
|
static int fdt_fixup_usb_mode_phy_type(void *blob, const char *mode,
|
||||||
const char *phy_type)
|
const char *phy_type, int start_offset)
|
||||||
{
|
{
|
||||||
const char *compat = "fsl-usb2-dr";
|
const char *compat = "fsl-usb2-dr";
|
||||||
const char *prop_mode = "dr_mode";
|
const char *prop_mode = "dr_mode";
|
||||||
const char *prop_type = "phy_type";
|
const char *prop_type = "phy_type";
|
||||||
static int start_offset = -1;
|
|
||||||
int node_offset;
|
int node_offset;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -102,7 +101,7 @@ static void fdt_fixup_usb_mode_phy_type(void *blob, const char *mode,
|
|||||||
if (node_offset < 0) {
|
if (node_offset < 0) {
|
||||||
printf("WARNING: could not find compatible node %s: %s.\n",
|
printf("WARNING: could not find compatible node %s: %s.\n",
|
||||||
compat, fdt_strerror(node_offset));
|
compat, fdt_strerror(node_offset));
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode) {
|
if (mode) {
|
||||||
@ -121,16 +120,18 @@ static void fdt_fixup_usb_mode_phy_type(void *blob, const char *mode,
|
|||||||
prop_type, compat, fdt_strerror(err));
|
prop_type, compat, fdt_strerror(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
start_offset = node_offset;
|
return node_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
|
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
|
||||||
{
|
{
|
||||||
const char *modes[] = { "host", "peripheral", "otg" };
|
const char *modes[] = { "host", "peripheral", "otg" };
|
||||||
const char *phys[] = { "ulpi", "umti" };
|
const char *phys[] = { "ulpi", "utmi" };
|
||||||
const char *mode = NULL;
|
const char *mode = NULL;
|
||||||
const char *phy_type = NULL;
|
const char *phy_type = NULL;
|
||||||
char usb1_defined = 0;
|
char usb1_defined = 0;
|
||||||
|
int usb_mode_off = -1;
|
||||||
|
int usb_phy_off = -1;
|
||||||
char str[5];
|
char str[5];
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -153,11 +154,11 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mode_idx >= 0)
|
if (mode_idx >= 0)
|
||||||
fdt_fixup_usb_mode_phy_type(blob,
|
usb_mode_off = fdt_fixup_usb_mode_phy_type(blob,
|
||||||
modes[mode_idx], NULL);
|
modes[mode_idx], NULL, usb_mode_off);
|
||||||
if (phy_idx >= 0)
|
if (phy_idx >= 0)
|
||||||
fdt_fixup_usb_mode_phy_type(blob,
|
usb_phy_off = fdt_fixup_usb_mode_phy_type(blob,
|
||||||
NULL, phys[phy_idx]);
|
NULL, phys[phy_idx], usb_phy_off);
|
||||||
if (!strcmp(str, "usb1"))
|
if (!strcmp(str, "usb1"))
|
||||||
usb1_defined = 1;
|
usb1_defined = 1;
|
||||||
if (mode_idx < 0 && phy_idx < 0)
|
if (mode_idx < 0 && phy_idx < 0)
|
||||||
@ -165,11 +166,12 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!usb1_defined) {
|
if (!usb1_defined) {
|
||||||
|
int usb_off = -1;
|
||||||
mode = getenv("usb_dr_mode");
|
mode = getenv("usb_dr_mode");
|
||||||
phy_type = getenv("usb_phy_type");
|
phy_type = getenv("usb_phy_type");
|
||||||
if (!mode && !phy_type)
|
if (!mode && !phy_type)
|
||||||
return;
|
return;
|
||||||
fdt_fixup_usb_mode_phy_type(blob, mode, phy_type);
|
fdt_fixup_usb_mode_phy_type(blob, mode, phy_type, usb_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_HAS_FSL_DR_USB */
|
#endif /* CONFIG_HAS_FSL_DR_USB */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user