Skip to contentSkip to conversation

drivers: usb: musb: Fail if the ctrl mod register is missing

PATCH New Adrian Ratiu 1 participant 5 messages Feb 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 drivers: usb: musb: Fail if the ctrl mod register is missing

From: Sjoerd Simons <[email protected]>

If the trcl mode register address cannot be found error out rather then trying to continue (which cannot work)

---
 drivers/usb/musb-new/ti-musb.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/musb-new/ti-musb.c +5 -0
index 20ca2731b49..725086928b3 100644
@@ -90,6 +90,11 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
 	phys = fdtdec_lookup_phandle(fdt, node, "phys");
 	ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
 	platdata->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
+	if (platdata->ctrl_mod_base == FDT_ADDR_T_NONE) {
+		pr_err("MUSB ctrl mod missing\n");
+		return -ENOENT;
+	}
+
 	usb_index = ti_musb_get_usb_index(node);
 	switch (usb_index) {
 	case 1:
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/5 drivers: usb: musb: Fix comparison between pointer and integer warn

drivers/usb/musb-new/ti-musb.c: In function 'ti_musb_ofdata_to_platdata':
drivers/usb/musb-new/ti-musb.c:93:30: warning: comparison between pointer and integer

	if (platdata->ctrl_mod_base == FDT_ADDR_T_NONE) {}
---
 drivers/usb/musb-new/ti-musb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/musb-new/ti-musb.c +1 -1
index 725086928b3..3326c7e4702 100644
@@ -90,7 +90,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
 	phys = fdtdec_lookup_phandle(fdt, node, "phys");
 	ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
 	platdata->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
-	if (platdata->ctrl_mod_base == FDT_ADDR_T_NONE) {
+	if (platdata->ctrl_mod_base == (void *)FDT_ADDR_T_NONE) {
 		pr_err("MUSB ctrl mod missing\n");
 		return -ENOENT;
 	}
Signature · 1 line
2.20.1
#2 lore raw

PATCH 3/5 spl: Add ability to disable SPL FAT

In reply to Adrian Ratiu

From: Sjoerd Simons <[email protected]>

spl_usb depends on FAT support, so don't try to build it if fat support is disabled for SPL.

---
 common/spl/Makefile | 2 ++
 1 file changed, 2 insertions(+)
common/spl/Makefile +2 -0
index e1daabf1e9c..42db0441559 100644
@@ -22,7 +22,9 @@ obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
 obj-$(CONFIG_$(SPL_TPL_)OPTEE) += spl_optee.o
+ifdef CONFIG_SPL_FS_FAT
 obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
+endif
 obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
Signature · 1 line
2.20.1
#3 lore raw

PATCH 4/5 spl: Add common usb support in spl if needed

In reply to Adrian Ratiu

From: Sjoerd Simons <[email protected]>

If build into the SPL at least the MUSB USB driver needs the common usb functionality (e.g. parsing of the DR role dt property), so build this.

---
 scripts/Makefile.spl | 1 +
 1 file changed, 1 insertion(+)
scripts/Makefile.spl +1 -0
index 9d5921606e1..52afe5bca8f 100644
@@ -87,6 +87,7 @@ endif
 endif
 
 libs-y += drivers/
+libs-$(CONFIG_SPL_USB_SUPPORT) += drivers/usb/common/
 libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
 libs-y += dts/
 libs-y += fs/
Signature · 1 line
2.20.1
#4 lore raw

PATCH 5/5 cmd: pxe: Increase MAX_TFTP_PATH_LEN to 256

In reply to Adrian Ratiu

From: Martyn Welch <[email protected]>

Despite the name it's also used for paths in distro configuration files (i.e. extlinux.conf). When using OSTree, it is very easy to reach the 127 character limit, thus increase to 256 bytes.

---
 cmd/pxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/pxe.c +1 -1
index 274555319ba..14022f13c69 100644
@@ -18,7 +18,7 @@
 #include "menu.h"
 #include "cli.h"
 
-#define MAX_TFTP_PATH_LEN 127
+#define MAX_TFTP_PATH_LEN 256
 
 const char *pxe_default_paths[] = {
 #ifdef CONFIG_SYS_SOC
Signature · 1 line
2.20.1