summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c4
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c68
-rw-r--r--firmware/test/i2c/gendata.c32
-rw-r--r--firmware/usbstack/usb_class_driver.h18
-rw-r--r--firmware/usbstack/usb_storage.c2
5 files changed, 62 insertions, 62 deletions
diff --git a/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c
index 33bbb6af48..8090c624df 100644
--- a/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c
@@ -26,8 +26,8 @@
26 26
27#define SMLAL(lo, hi, x, y) \ 27#define SMLAL(lo, hi, x, y) \
28 asm volatile ("smlal %0, %1, %2, %3" \ 28 asm volatile ("smlal %0, %1, %2, %3" \
29 : "+r" (lo), "+r" (hi) \ 29 : "+r" (lo), "+r" (hi) \
30 : "%r" (x), "r" (y)) 30 : "%r" (x), "r" (y))
31 31
32const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 32const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
33{ 33{
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
index 02294100ac..ab3ceba0f3 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
@@ -37,7 +37,7 @@ static size_t size;
37 37
38void pcm_postinit(void) 38void pcm_postinit(void)
39{ 39{
40 audiohw_postinit(); 40 audiohw_postinit();
41} 41}
42 42
43/* Return the current location in the SDRAM to SARAM transfer along with the 43/* Return the current location in the SDRAM to SARAM transfer along with the
@@ -48,7 +48,7 @@ void pcm_postinit(void)
48 */ 48 */
49const void * pcm_play_dma_get_peak_buffer(int *count) 49const void * pcm_play_dma_get_peak_buffer(int *count)
50{ 50{
51 int cnt = DSP_(_sdem_level); 51 int cnt = DSP_(_sdem_level);
52 52
53 unsigned long addr = (unsigned long) start +cnt; 53 unsigned long addr = (unsigned long) start +cnt;
54 54
@@ -73,7 +73,7 @@ void pcm_play_dma_init(void)
73 73
74void pcm_dma_apply_settings(void) 74void pcm_dma_apply_settings(void)
75{ 75{
76 audiohw_set_frequency(pcm_fsel); 76 audiohw_set_frequency(pcm_fsel);
77} 77}
78 78
79/* Note that size is actually limited to the size of a short right now due to 79/* Note that size is actually limited to the size of a short right now due to
@@ -81,7 +81,7 @@ void pcm_dma_apply_settings(void)
81 */ 81 */
82void pcm_play_dma_start(const void *addr, size_t size) 82void pcm_play_dma_start(const void *addr, size_t size)
83{ 83{
84 unsigned long sdem_addr=(unsigned long)addr - CONFIG_SDRAM_START; 84 unsigned long sdem_addr=(unsigned long)addr - CONFIG_SDRAM_START;
85 /* Initialize codec. */ 85 /* Initialize codec. */
86 DSP_(_sdem_addrl) = sdem_addr & 0xffff; 86 DSP_(_sdem_addrl) = sdem_addr & 0xffff;
87 DSP_(_sdem_addrh) = sdem_addr >> 16; 87 DSP_(_sdem_addrh) = sdem_addr >> 16;
@@ -116,7 +116,7 @@ void pcm_play_dma_pause(bool pause)
116 } 116 }
117 else 117 else
118 { 118 {
119 DSP_(_dma0_stopped)=0; 119 DSP_(_dma0_stopped)=0;
120 dsp_wake(); 120 dsp_wake();
121 } 121 }
122} 122}
@@ -132,8 +132,8 @@ char buffer[80];
132void DSPHINT(void) __attribute__ ((section(".icode"))); 132void DSPHINT(void) __attribute__ ((section(".icode")));
133void DSPHINT(void) 133void DSPHINT(void)
134{ 134{
135 register pcm_more_callback_type get_more; /* No stack for this */ 135 register pcm_more_callback_type get_more; /* No stack for this */
136 136
137 unsigned int i; 137 unsigned int i;
138 138
139 IO_INTC_FIQ0 = 1 << 11; 139 IO_INTC_FIQ0 = 1 << 11;
@@ -151,35 +151,35 @@ void DSPHINT(void)
151 break; 151 break;
152 152
153 case MSG_REFILL: 153 case MSG_REFILL:
154 /* Buffer empty. Try to get more. */ 154 /* Buffer empty. Try to get more. */
155 get_more = pcm_callback_for_more; 155 get_more = pcm_callback_for_more;
156 size = 0; 156 size = 0;
157 157
158 if (get_more == NULL || (get_more(&start, &size), size == 0)) 158 if (get_more == NULL || (get_more(&start, &size), size == 0))
159 { 159 {
160 /* Callback missing or no more DMA to do */ 160 /* Callback missing or no more DMA to do */
161 pcm_play_dma_stop(); 161 pcm_play_dma_stop();
162 pcm_play_dma_stopped_callback(); 162 pcm_play_dma_stopped_callback();
163 } 163 }
164 164
165 { 165 {
166 unsigned long sdem_addr=(unsigned long)start - CONFIG_SDRAM_START; 166 unsigned long sdem_addr=(unsigned long)start - CONFIG_SDRAM_START;
167 /* Flush any pending cache writes */ 167 /* Flush any pending cache writes */
168 clean_dcache_range(start, size); 168 clean_dcache_range(start, size);
169 169
170 /* set the new DMA values */ 170 /* set the new DMA values */
171 DSP_(_sdem_addrl) = sdem_addr & 0xffff; 171 DSP_(_sdem_addrl) = sdem_addr & 0xffff;
172 DSP_(_sdem_addrh) = sdem_addr >> 16; 172 DSP_(_sdem_addrh) = sdem_addr >> 16;
173 DSP_(_sdem_dsp_size) = size; 173 DSP_(_sdem_dsp_size) = size;
174 174
175 DEBUGF("pcm_sdram at 0x%08lx, sdem_addr 0x%08lx", 175 DEBUGF("pcm_sdram at 0x%08lx, sdem_addr 0x%08lx",
176 (unsigned long)start, (unsigned long)sdem_addr); 176 (unsigned long)start, (unsigned long)sdem_addr);
177 } 177 }
178 178
179 break; 179 break;
180 default: 180 default:
181 DEBUGF("DSP: unknown msg 0x%04x", dsp_message.msg); 181 DEBUGF("DSP: unknown msg 0x%04x", dsp_message.msg);
182 break; 182 break;
183 } 183 }
184 184
185 /* Re-Activate the channel */ 185 /* Re-Activate the channel */
diff --git a/firmware/test/i2c/gendata.c b/firmware/test/i2c/gendata.c
index 03bb002b88..dc5989ee66 100644
--- a/firmware/test/i2c/gendata.c
+++ b/firmware/test/i2c/gendata.c
@@ -10,22 +10,22 @@ int main(int argc, char *argv[])
10 10
11 if(f) 11 if(f)
12 { 12 {
13 if(fread(buf, 1, 128000, f) < 128000) 13 if(fread(buf, 1, 128000, f) < 128000)
14 { 14 {
15 fprintf(stderr, "FAN!\n"); 15 fprintf(stderr, "FAN!\n");
16 exit(1); 16 exit(1);
17 } 17 }
18 18
19 printf("int mp3datalen = 128000;\n"); 19 printf("int mp3datalen = 128000;\n");
20 printf("unsigned char mp3data[128000] =\n{"); 20 printf("unsigned char mp3data[128000] =\n{");
21 for(i = 0;i < 128000;i++) 21 for(i = 0;i < 128000;i++)
22 { 22 {
23 if(i % 8 == 0) 23 if(i % 8 == 0)
24 { 24 {
25 printf("\n"); 25 printf("\n");
26 } 26 }
27 printf("0x%02x, ", buf[i]); 27 printf("0x%02x, ", buf[i]);
28 } 28 }
29 printf("};\n"); 29 printf("};\n");
30 } 30 }
31} 31}
diff --git a/firmware/usbstack/usb_class_driver.h b/firmware/usbstack/usb_class_driver.h
index a9bc759a5b..c8d1e7047d 100644
--- a/firmware/usbstack/usb_class_driver.h
+++ b/firmware/usbstack/usb_class_driver.h
@@ -41,46 +41,46 @@ struct usb_class_driver {
41 /* Tells the driver what its first interface number will be. The driver 41 /* Tells the driver what its first interface number will be. The driver
42 returns the number of the first available interface for the next driver 42 returns the number of the first available interface for the next driver
43 (i.e. a driver with one interface will return interface+1) 43 (i.e. a driver with one interface will return interface+1)
44 A driver must have at least one interface 44 A driver must have at least one interface
45 Mandatory function */ 45 Mandatory function */
46 int (*set_first_interface)(int interface); 46 int (*set_first_interface)(int interface);
47 47
48 /* Asks the driver to put the interface descriptor and all other 48 /* Asks the driver to put the interface descriptor and all other
49 needed descriptor for this driver at dest. 49 needed descriptor for this driver at dest.
50 Returns the number of bytes taken by these descriptors. 50 Returns the number of bytes taken by these descriptors.
51 Mandatory function */ 51 Mandatory function */
52 int (*get_config_descriptor)(unsigned char *dest, int max_packet_size); 52 int (*get_config_descriptor)(unsigned char *dest, int max_packet_size);
53 53
54 /* Tells the driver that a usb connection has been set up and is now 54 /* Tells the driver that a usb connection has been set up and is now
55 ready to use. 55 ready to use.
56 Optional function */ 56 Optional function */
57 void (*init_connection)(void); 57 void (*init_connection)(void);
58 58
59 /* Initialises the driver. This can be called multiple times, 59 /* Initialises the driver. This can be called multiple times,
60 and should not perform any action that can disturb other threads 60 and should not perform any action that can disturb other threads
61 (like getting the audio buffer) 61 (like getting the audio buffer)
62 Optional function */ 62 Optional function */
63 void (*init)(void); 63 void (*init)(void);
64 64
65 /* Tells the driver that the usb connection is no longer active 65 /* Tells the driver that the usb connection is no longer active
66 Optional function */ 66 Optional function */
67 void (*disconnect)(void); 67 void (*disconnect)(void);
68 68
69 /* Tells the driver that a usb transfer has been completed. Note that "dir" 69 /* Tells the driver that a usb transfer has been completed. Note that "dir"
70 is relative to the host 70 is relative to the host
71 Optional function */ 71 Optional function */
72 void (*transfer_complete)(int ep,int dir, int status, int length); 72 void (*transfer_complete)(int ep,int dir, int status, int length);
73 73
74 /* Tells the driver that a control request has come in. If the driver is 74 /* Tells the driver that a control request has come in. If the driver is
75 able to handle it, it should ack the request, and return true. Otherwise 75 able to handle it, it should ack the request, and return true. Otherwise
76 it should return false. 76 it should return false.
77 Optional function */ 77 Optional function */
78 bool (*control_request)(struct usb_ctrlrequest* req, unsigned char *dest); 78 bool (*control_request)(struct usb_ctrlrequest* req, unsigned char *dest);
79 79
80#ifdef HAVE_HOTSWAP 80#ifdef HAVE_HOTSWAP
81 /* Tells the driver that a hotswappable disk/card was inserted or 81 /* Tells the driver that a hotswappable disk/card was inserted or
82 extracted 82 extracted
83 Optional function */ 83 Optional function */
84 void (*notify_hotswap)(int volume, bool inserted); 84 void (*notify_hotswap)(int volume, bool inserted);
85#endif 85#endif
86}; 86};
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index f84cd4eefe..f8e3aba839 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -71,7 +71,7 @@
71#define USB_BULK_RESET_REQUEST 0xff 71#define USB_BULK_RESET_REQUEST 0xff
72#define USB_BULK_GET_MAX_LUN 0xfe 72#define USB_BULK_GET_MAX_LUN 0xfe
73 73
74#define DIRECT_ACCESS_DEVICE 0x00 /* disks */ 74#define DIRECT_ACCESS_DEVICE 0x00 /* disks */
75#define DEVICE_REMOVABLE 0x80 75#define DEVICE_REMOVABLE 0x80
76 76
77#define CBW_SIGNATURE 0x43425355 77#define CBW_SIGNATURE 0x43425355