diff options
author | Tomasz Moń <desowin@gmail.com> | 2021-06-05 09:22:27 +0200 |
---|---|---|
committer | Tomasz Moń <desowin@gmail.com> | 2021-06-06 07:57:38 +0000 |
commit | 474293a12b6152041404378abd932ac495e5e18d (patch) | |
tree | 752c777a4b326d40216da1868e5c7aedaccfa7bd /bootloader/sansaconnect.c | |
parent | 77603c344dd4946d0319688c3b58bf9e1507d9aa (diff) | |
download | rockbox-474293a12b6152041404378abd932ac495e5e18d.tar.gz rockbox-474293a12b6152041404378abd932ac495e5e18d.zip |
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
Diffstat (limited to 'bootloader/sansaconnect.c')
-rw-r--r-- | bootloader/sansaconnect.c | 20 |
1 files changed, 17 insertions, 3 deletions
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 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: $ | 8 | * $Id: $ |
9 | * | 9 | * |
10 | * Copyright (C) 2011 by Tomasz Moń | 10 | * Copyright (C) 2011-2021 by Tomasz Moń |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -32,6 +32,7 @@ | |||
32 | #include "uart-target.h" | 32 | #include "uart-target.h" |
33 | #include "power.h" | 33 | #include "power.h" |
34 | #include "loader_strerror.h" | 34 | #include "loader_strerror.h" |
35 | #include "usb.h" | ||
35 | 36 | ||
36 | #define FLASH_BASE 0x00100000 | 37 | #define FLASH_BASE 0x00100000 |
37 | #define PARAMETERS_FLASH_OFFSET 0x00010000 | 38 | #define PARAMETERS_FLASH_OFFSET 0x00010000 |
@@ -206,6 +207,8 @@ void main(void) | |||
206 | 207 | ||
207 | printf("Rockbox boot loader"); | 208 | printf("Rockbox boot loader"); |
208 | printf("Version %s", rbversion); | 209 | printf("Version %s", rbversion); |
210 | usb_init(); | ||
211 | usb_start_monitoring(); | ||
209 | 212 | ||
210 | clear_recoverzap(); | 213 | clear_recoverzap(); |
211 | 214 | ||
@@ -215,6 +218,17 @@ void main(void) | |||
215 | 218 | ||
216 | filesystem_init(); | 219 | filesystem_init(); |
217 | 220 | ||
221 | if (usb_detect() == USB_INSERTED) | ||
222 | { | ||
223 | usb_enable(true); | ||
224 | while (usb_detect() == USB_INSERTED) | ||
225 | { | ||
226 | sleep(HZ); | ||
227 | storage_spin(); | ||
228 | } | ||
229 | usb_enable(false); | ||
230 | } | ||
231 | |||
218 | ret = disk_mount_all(); | 232 | ret = disk_mount_all(); |
219 | if (ret <= 0) | 233 | if (ret <= 0) |
220 | error(EDISK, ret, true); | 234 | error(EDISK, ret, true); |
@@ -269,8 +283,8 @@ void main(void) | |||
269 | ret = kernel_entry(); | 283 | ret = kernel_entry(); |
270 | printf("FAILED!"); | 284 | printf("FAILED!"); |
271 | } | 285 | } |
272 | 286 | ||
273 | storage_sleepnow(); | 287 | storage_sleepnow(); |
274 | 288 | ||
275 | while(1); | 289 | while(1); |
276 | } | 290 | } |