From 6492c2959cbea6dd6d46fc64267b88c19cf14e8a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 18 Nov 2010 23:06:43 +0100 Subject: req_ctx: Increase size of small req_ctx to 128 and have 16 instead of 8 This is required to deal with bursts in SIM comminication while using the SIMTRACE firmware --- firmware/src/os/req_ctx.c | 4 ++-- firmware/src/os/req_ctx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/req_ctx.c b/firmware/src/os/req_ctx.c index 73b6035..0e4816e 100644 --- a/firmware/src/os/req_ctx.c +++ b/firmware/src/os/req_ctx.c @@ -29,8 +29,8 @@ /* FIXME: locking, FIFO order processing */ #ifdef __AT91SAM7S64__ -#define NUM_RCTX_SMALL 4 -#define NUM_RCTX_LARGE 2 +#define NUM_RCTX_SMALL 16 +#define NUM_RCTX_LARGE 1 #else #define NUM_RCTX_SMALL 8 #define NUM_RCTX_LARGE 4 diff --git a/firmware/src/os/req_ctx.h b/firmware/src/os/req_ctx.h index ac9ab3f..94b5c5a 100644 --- a/firmware/src/os/req_ctx.h +++ b/firmware/src/os/req_ctx.h @@ -2,7 +2,7 @@ #define _REQ_CTX_H #define RCTX_SIZE_LARGE 2048 -#define RCTX_SIZE_SMALL 64 +#define RCTX_SIZE_SMALL 128 #define MAX_HDRSIZE sizeof(struct openpcd_hdr) #define MAX_REQSIZE (64-MAX_HDRSIZE) -- cgit v1.2.3 From cda126a7ef6fbb54a18a4786c15117800a13f7b3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 16 Jun 2011 21:16:13 +0200 Subject: simtrace: add support for the analog bus switch --- firmware/src/os/dbgu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/dbgu.c b/firmware/src/os/dbgu.c index 026b56b..28d86a4 100644 --- a/firmware/src/os/dbgu.c +++ b/firmware/src/os/dbgu.c @@ -147,7 +147,7 @@ void AT91F_DBGU_Init(void) sysirq_register(AT91SAM7_SYSIRQ_DBGU, &DBGU_irq_handler); AT91F_DBGU_Printk("\n\r"); - AT91F_DBGU_Printk("(C) 2006 by Harald Welte \n\r" + AT91F_DBGU_Printk("(C) 2006-2011 by Harald Welte \n\r" "This software is FREE SOFTWARE licensed under GNU GPL\n\r"); AT91F_DBGU_Printk("Version " COMPILE_SVNREV " compiled " COMPILE_DATE -- cgit v1.2.3 From a23eefc6dc5f45498116f69125f6e12f53a81130 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 7 Jul 2011 17:43:55 +0200 Subject: USB driver: use the DFU-provided function to send EP0 data There is no point in replicating the functionality that already exists in the DFU section of the flash --- firmware/src/os/pcd_enumerate.c | 49 +---------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/pcd_enumerate.c b/firmware/src/os/pcd_enumerate.c index b4392c0..a195267 100644 --- a/firmware/src/os/pcd_enumerate.c +++ b/firmware/src/os/pcd_enumerate.c @@ -78,7 +78,7 @@ #ifdef CONFIG_DFU static const struct dfuapi *dfu = DFU_API_LOCATION; #define udp_init dfu->udp_init -//#define udp_ep0_send_data dfu->ep0_send_data +#define udp_ep0_send_data dfu->ep0_send_data #define udp_ep0_send_zlp dfu->ep0_send_zlp #define udp_ep0_send_stall dfu->ep0_send_stall #else @@ -107,53 +107,6 @@ static const struct epstate epstate[] = { .state_pending = RCTX_STATE_UDP_EP3_PENDING }, }; -/* Send Data through the control endpoint */ -static void udp_ep0_send_data(const char *pData, u_int32_t length) -{ - AT91PS_UDP pUdp = AT91C_BASE_UDP; - u_int32_t cpt = 0; - AT91_REG csr; - - DEBUGE("send_data: %u bytes ", length); - - do { - cpt = MIN(length, 8); - length -= cpt; - - DEBUGE("fifo_fill "); - while (cpt--) - pUdp->UDP_FDR[0] = *pData++; - - if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { - DEBUGE("wait_txcomp_clear "); - pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); - while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; - } - - DEBUGE("set_txpktrdy "); - pUdp->UDP_CSR[0] |= AT91C_UDP_TXPKTRDY; - DEBUGE("wait_txcomp "); - do { - csr = pUdp->UDP_CSR[0]; - - /* Data IN stage has been stopped by a status OUT */ - if (csr & AT91C_UDP_RX_DATA_BK0) { - pUdp->UDP_CSR[0] &= ~(AT91C_UDP_RX_DATA_BK0); - DEBUGE("stopped by status out "); - return; - } - } while (!(csr & AT91C_UDP_TXCOMP)); - - } while (length); - - DEBUGE("clear_txcomp "); - if (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) { - pUdp->UDP_CSR[0] &= ~(AT91C_UDP_TXCOMP); - while (pUdp->UDP_CSR[0] & AT91C_UDP_TXCOMP) ; - } - DEBUGE("done "); -} - static void reset_ep(unsigned int ep) { AT91PS_UDP pUDP = upcd.pUdp; -- cgit v1.2.3 From 5a8cd9feca7d0d09aee736ff804be4967828aefd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 00:37:04 +0200 Subject: add new RUN_FROM_RAM run-mode for direct DFU-to-RAM support --- firmware/src/os/req_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/req_ctx.c b/firmware/src/os/req_ctx.c index 0e4816e..cc8d57b 100644 --- a/firmware/src/os/req_ctx.c +++ b/firmware/src/os/req_ctx.c @@ -28,7 +28,7 @@ /* FIXME: locking, FIFO order processing */ -#ifdef __AT91SAM7S64__ +#if defined(__AT91SAM7S64__) || defined(RUN_FROM_RAM) #define NUM_RCTX_SMALL 16 #define NUM_RCTX_LARGE 1 #else -- cgit v1.2.3 From e3d1fd9bbdb789196c25bdd5eb7536cda5ba39f3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 30 Jul 2011 02:08:36 +0200 Subject: DFU: add third 'alternate configuration' for RAM load This will allow us to load code directly into RAM without going through flash. --- firmware/src/os/usb_descriptors_openpcd.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'firmware/src/os') diff --git a/firmware/src/os/usb_descriptors_openpcd.h b/firmware/src/os/usb_descriptors_openpcd.h index ceb7ff6..58c54ec 100644 --- a/firmware/src/os/usb_descriptors_openpcd.h +++ b/firmware/src/os/usb_descriptors_openpcd.h @@ -20,8 +20,8 @@ const struct usb_device_descriptor dev_descriptor = { .idProduct = USB_PRODUCT_ID, .bcdDevice = 0x0030, /* Version 0.3 */ #ifdef CONFIG_USB_STRING - .iManufacturer = 3, - .iProduct = 4, + .iManufacturer = 4, + .iProduct = 5, .iSerialNumber = 0, #else .iManufacturer = 0, @@ -36,7 +36,7 @@ struct _desc { struct usb_interface_descriptor uif; struct usb_endpoint_descriptor ep[3]; #ifdef CONFIG_DFU - struct usb_interface_descriptor uif_dfu[2]; + struct usb_interface_descriptor uif_dfu[3]; #endif }; @@ -46,9 +46,9 @@ const struct _desc cfg_descriptor = { .bDescriptorType = USB_DT_CONFIG, .wTotalLength = USB_DT_CONFIG_SIZE + #ifdef CONFIG_DFU - 3 * USB_DT_INTERFACE_SIZE + + 4 * USB_DT_INTERFACE_SIZE + 3 * USB_DT_ENDPOINT_SIZE, - .bNumInterfaces = 3, + .bNumInterfaces = 4, #else 1 * USB_DT_INTERFACE_SIZE + 3 * USB_DT_ENDPOINT_SIZE, @@ -56,7 +56,7 @@ const struct _desc cfg_descriptor = { #endif .bConfigurationValue = 1, #ifdef CONFIG_USB_STRING - .iConfiguration = 5, + .iConfiguration = 6, #else .iConfiguration = 0, #endif @@ -73,7 +73,7 @@ const struct _desc cfg_descriptor = { .bInterfaceSubClass = 0, .bInterfaceProtocol = 0xff, #ifdef CONFIG_USB_STRING - .iInterface = 6, + .iInterface = 7, #else .iInterface = 0, #endif -- cgit v1.2.3