From 474293a12b6152041404378abd932ac495e5e18d Mon Sep 17 00:00:00 2001 From: Tomasz Moń Date: Sat, 5 Jun 2021 09:22:27 +0200 Subject: Sansa Connect: Initial TNETV105 driver port Port USB driver from Sansa Connect Linux kernel sources. The device successfully enumerates and responds to SCSI commands but actual disk access does not work. The SCSI response sent to host mentions that both internal storage and microsd card are not present. Change-Id: Ic6c07da12382c15c0b069f23a75f7df9765b7525 --- bootloader/sansaconnect.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'bootloader/sansaconnect.c') diff --git a/bootloader/sansaconnect.c b/bootloader/sansaconnect.c index a87b23745f..c5dbca717d 100644 --- a/bootloader/sansaconnect.c +++ b/bootloader/sansaconnect.c @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id: $ * -* Copyright (C) 2011 by Tomasz Moń +* Copyright (C) 2011-2021 by Tomasz Moń * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. @@ -32,6 +32,7 @@ #include "uart-target.h" #include "power.h" #include "loader_strerror.h" +#include "usb.h" #define FLASH_BASE 0x00100000 #define PARAMETERS_FLASH_OFFSET 0x00010000 @@ -206,6 +207,8 @@ void main(void) printf("Rockbox boot loader"); printf("Version %s", rbversion); + usb_init(); + usb_start_monitoring(); clear_recoverzap(); @@ -215,6 +218,17 @@ void main(void) filesystem_init(); + if (usb_detect() == USB_INSERTED) + { + usb_enable(true); + while (usb_detect() == USB_INSERTED) + { + sleep(HZ); + storage_spin(); + } + usb_enable(false); + } + ret = disk_mount_all(); if (ret <= 0) error(EDISK, ret, true); @@ -269,8 +283,8 @@ void main(void) ret = kernel_entry(); printf("FAILED!"); } - + storage_sleepnow(); - + while(1); } -- cgit v1.2.3