diff options
| author | Scott Larson <[email protected]> | 2020-08-14 10:45:58 -0700 |
|---|---|---|
| committer | Scott Larson <[email protected]> | 2020-08-14 10:45:58 -0700 |
| commit | 10ad1105ef70e8954e8beb684b409a5c8b5cedd1 (patch) | |
| tree | ba9c570a0b61c30f55651a838311742c7483b901 | |
| parent | 0ae68ff7d12bb4c359fa062ffd905f8cf4c58e24 (diff) | |
apply 6.0.2 patch and add additional architectures and toolchain supportv6.0.2_rel
32 files changed, 4536 insertions, 48 deletions
diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 903e3ed..4dacbcf 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* ux_api.h PORTABLE C */ -/* 6.0.1 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -49,6 +49,9 @@ /* avoided div 0 in overflow */ /* checking macro, */ /* resulting in version 6.0.1 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), and */ +/* updated product constants, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -137,7 +140,7 @@ typedef signed char SCHAR; #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 #define USBX_MINOR_VERSION 0 -#define USBX_PATCH_VERSION 1 +#define USBX_PATCH_VERSION 2 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ diff --git a/common/usbx_device_classes/inc/ux_device_class_storage.h b/common/usbx_device_classes/inc/ux_device_class_storage.h index c1ca49b..c2e7858 100644 --- a/common/usbx_device_classes/inc/ux_device_class_storage.h +++ b/common/usbx_device_classes/inc/ux_device_class_storage.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_storage.h PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* added mode related macros, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -167,12 +170,23 @@ #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_6 1 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_10 2 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_6 2 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_10 3 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAG_WP 0x80 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_6 4 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_10 8 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_COMMAND_LENGTH_UFI 12 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_COMMAND_LENGTH_SBC 12 +#define UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH 0x0A + +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH 0x12 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_CODE 0 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_LENGTH 1 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAGS 2 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAG_WCE (1u<<2) + /* Define Storage Class SCSI request sense command constants. */ diff --git a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c index 53934c5..c7a1829 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c @@ -47,8 +47,8 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ #else #define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH (0) #endif -#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CACHE_LENGTH (0x12 + 2) -#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_IEC_LENGTH (0x0A + 2) +#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CACHE_LENGTH (UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH + 2) +#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_IEC_LENGTH (UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH + 2) /* Ensure sense pages can fit in the bulk in endpoint's transfer buffer. */ #define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_ALL_RESPONSE_LENGTH ( \ @@ -65,7 +65,7 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_mode_sense PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -104,6 +104,11 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* used mode related macros, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage, @@ -120,7 +125,7 @@ ULONG page_code; ULONG mode_sense_command; UCHAR read_only_flag; ULONG response_header_length; -ULONG medium_type_index; +ULONG flags_index; ULONG mode_data_length; UCHAR *page_pointer; ULONG page_length; @@ -146,7 +151,7 @@ ULONG page_length; /* Extract the length to be returned by the cbwcb. */ mode_sense_reply_length = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_ALLOCATION_LENGTH_6); - medium_type_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_6; + flags_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_6; response_header_length = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_6; } @@ -155,7 +160,7 @@ ULONG page_length; /* Extract the length to be returned by the cbwcb. */ mode_sense_reply_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_ALLOCATION_LENGTH_10); - medium_type_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_10; + flags_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_10; response_header_length = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_10; } @@ -164,13 +169,13 @@ ULONG page_length; mode_sense_reply_length = UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE; /* Ensure memory buffer cleaned. */ - _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, mode_sense_reply_length); + _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, mode_sense_reply_length); /* Use case of memset is verified. */ /* Establish READ ONLY flag. */ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_read_only_flag == UX_TRUE) /* This device is Read Only. */ - read_only_flag = 0x80; + read_only_flag = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAG_WP; else @@ -191,7 +196,7 @@ ULONG page_length; page_length = USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH; /* Copy page data. */ - _ux_utility_memory_copy(page_pointer, usbx_device_class_storage_mode_sense_page_cdrom, page_length); + _ux_utility_memory_copy(page_pointer, usbx_device_class_storage_mode_sense_page_cdrom, page_length); /* Use case of memcpy is verified. */ /* Update pointer and length. */ mode_data_length += page_length; @@ -210,10 +215,12 @@ ULONG page_length; *(page_pointer) = UX_SLAVE_CLASS_STORAGE_PAGE_CODE_CACHE; /* Store the length of the page data. */ - *(page_pointer + 1) = 0x12; + *(page_pointer + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_LENGTH) = + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH; /* Set the Write Cache Enabled (WCE) bit. */ - *(page_pointer + 2) |= 0x04; + *(page_pointer + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAGS) |= + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAG_WCE; mode_data_length += page_length; page_pointer += page_length; @@ -229,7 +236,7 @@ ULONG page_length; *(page_pointer) = UX_SLAVE_CLASS_STORAGE_PAGE_CODE_IEC; /* Store the length of the page data. */ - *(page_pointer + 1) = 0x0A; + *(page_pointer + 1) = UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH; mode_data_length += page_length; page_pointer += page_length; @@ -242,7 +249,7 @@ ULONG page_length; _ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer, (USHORT)mode_data_length); /* Store the write protection flag. */ - *(transfer_request -> ux_slave_transfer_request_data_pointer + medium_type_index + 1) = read_only_flag; + *(transfer_request -> ux_slave_transfer_request_data_pointer + flags_index) = read_only_flag; /* Send a payload with the response buffer. */ _ux_device_stack_transfer_request(transfer_request, mode_sense_reply_length, mode_sense_reply_length); diff --git a/common/usbx_host_classes/inc/ux_host_class_hid.h b/common/usbx_host_classes/inc/ux_host_class_hid.h index acce24e..d7aa0d5 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid.h PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed struct field */ +/* definition issues, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -847,7 +851,7 @@ typedef struct UX_HOST_CLASS_HID_FIELD_STRUCT ULONG ux_host_class_hid_field_number_usage; ULONG *ux_host_class_hid_field_values; ULONG ux_host_class_hid_field_number_values; - struct UX_HOST_CLASS_HID_REPORT + struct UX_HOST_CLASS_HID_REPORT_STRUCT *ux_host_class_hid_field_report; struct UX_HOST_CLASS_HID_FIELD_STRUCT *ux_host_class_hid_field_next_field; diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c index acf0f01..5deb535 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_get PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* protected default control */ +/* endpoint before using it, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id) @@ -116,6 +120,25 @@ UINT status; return(UX_MEMORY_INSUFFICIENT); } + /* Protect the control endpoint semaphore here. It will be unprotected in the + transfer request function. */ + status = _ux_utility_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER); + + /* Check for status. */ + if (status != UX_SUCCESS) + { + + /* Something went wrong. */ + + /* Free allocated memory. */ + _ux_utility_memory_free(idle_byte); + + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&hid -> ux_host_class_hid_semaphore); + + return(status); + } + /* Create a transfer request for the GET_IDLE request. */ transfer_request -> ux_transfer_request_data_pointer = idle_byte; transfer_request -> ux_transfer_request_requested_length = 1; diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c index a7fd64d..42eaf96 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_set PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* protected default control */ +/* endpoint before using it, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) @@ -97,6 +101,21 @@ UINT status; if (status != UX_SUCCESS) return(status); + /* Protect the control endpoint semaphore here. It will be unprotected in the + transfer request function. */ + status = _ux_utility_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER); + + /* Check for status. */ + if (status != UX_SUCCESS) + { + + /* Something went wrong. */ + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&hid -> ux_host_class_hid_semaphore); + + return(status); + } + /* We need to get the default control endpoint transfer request pointer. */ control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint; transfer_request = &control_endpoint -> ux_endpoint_transfer_request; diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c index add69ce..0c3cd1d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_get PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, accepted both INPUT */ +/* and FEATURE reports, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) @@ -112,8 +117,9 @@ UINT status; /* Get the report pointer from the caller. */ hid_report = client_report -> ux_host_class_hid_client_report; - /* Ensure this is a INPUT report. */ - if (hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_INPUT) + /* Ensure this is a INPUT report or FEATURE report. */ + if (hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_INPUT && + hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_FEATURE) { /* Unprotect thread reentry to this instance. */ @@ -202,7 +208,7 @@ UINT status; { /* We have enough memory to store the raw buffer. */ - _ux_utility_memory_copy(client_report -> ux_host_class_hid_client_report_buffer, report_buffer, transfer_request -> ux_transfer_request_actual_length); + _ux_utility_memory_copy(client_report -> ux_host_class_hid_client_report_buffer, report_buffer, transfer_request -> ux_transfer_request_actual_length); /* Use case of memcpy is verified. */ /* Set status to success. */ status = UX_SUCCESS; diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c index fb2cee4..4c30840 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_asynchronous_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_asynchronous_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -162,14 +166,10 @@ ULONG ohci_register; if (next_ed != UX_NULL) next_ed -> ux_ohci_ed_previous_ed = previous_ed; - /* We use the tail TD as a pointer to the Dummy TD. */ - tail_td = (UX_OHCI_TD *) _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); - /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *) value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c index 5ecf246..932925e 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_interrupt_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_interrupt_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -199,7 +203,10 @@ UINT interval_ohci; /* Check for end of tree which happens for devices with interval of 1. In this case there might not be a next_ed. */ if (next_ed != UX_NULL) + { + next_ed = _ux_utility_virtual_address(next_ed); next_ed -> ux_ohci_ed_previous_ed = ed; + } ed -> ux_ohci_ed_next_ed = _ux_utility_physical_address(next_ed); ed -> ux_ohci_ed_previous_ed = ed_list; ed_list -> ux_ohci_ed_next_ed = _ux_utility_physical_address(ed); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c index dd185c0..b6b57e2 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_next_td_clean PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_next_td_clean(UX_OHCI_TD *td) @@ -83,12 +87,12 @@ ULONG value_carry; ed = td -> ux_ohci_td_ed; /* Ensure that the potential Carry bit is maintained in the head ED. */ - value_carry = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; + value_carry = (ULONG)(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c index f99fe04..9e70d63 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_periodic_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_periodic_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -113,18 +117,17 @@ ULONG value_td; /* There may not be any next endpoint. But if there is one, link it to the previous ED. */ if (next_ed != UX_NULL) + { /* Update the previous ED pointer in the next ED. */ + next_ed = _ux_utility_virtual_address(next_ed); next_ed -> ux_ohci_ed_previous_ed = previous_ed; - - /* We use the tail TD as a pointer to the Dummy TD. */ - tail_td = (UX_OHCI_TD *) _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); + } /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c index 61c7a9e..e76fb2f 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_transfer_abort(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) @@ -108,13 +112,12 @@ ULONG value_carry; _ux_utility_delay_ms(1); /* Ensure that the potential Carry bit is maintained in the head ED. */ - value_carry = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; + value_carry = (ULONG)(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h new file mode 100644 index 0000000..c689e22 --- /dev/null +++ b/ports/arm9/gnu/inc/ux_port.h @@ -0,0 +1,216 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h ARM9/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 16 +#endif + + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + +/* Define memory barrier instruction. */ + +#define UX_DATA_MEMORY_BARRIER __asm__ __volatile__("MCR p15, 0, r0, c7, c10, 4"); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/arm9/iar/inc/ux_port.h b/ports/arm9/iar/inc/ux_port.h new file mode 100644 index 0000000..d747134 --- /dev/null +++ b/ports/arm9/iar/inc/ux_port.h @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h ARM9/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 2 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + +/* Define memory barrier instruction. */ + +#define UX_DATA_MEMORY_BARRIER __asm volatile("MCR p15, 0, r0, c7, c10, 4"); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a15/gnu/inc/ux_port.h b/ports/cortex_a15/gnu/inc/ux_port.h new file mode 100644 index 0000000..0f6cb9f --- /dev/null +++ b/ports/cortex_a15/gnu/inc/ux_port.h @@ -0,0 +1,212 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A15/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 16 +#endif + + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a5/gnu/inc/ux_port.h b/ports/cortex_a5/gnu/inc/ux_port.h new file mode 100644 index 0000000..ce74705 --- /dev/null +++ b/ports/cortex_a5/gnu/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A5/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 16 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a5/iar/inc/ux_port.h b/ports/cortex_a5/iar/inc/ux_port.h new file mode 100644 index 0000000..0910d52 --- /dev/null +++ b/ports/cortex_a5/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A5/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 16 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a5x/ac6/inc/ux_port.h b/ports/cortex_a5x/ac6/inc/ux_port.h new file mode 100644 index 0000000..55a1011 --- /dev/null +++ b/ports/cortex_a5x/ac6/inc/ux_port.h @@ -0,0 +1,236 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A5x/AC6 */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* TCRG, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 16 +#endif + + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +/* Define the extension to hold the control block for 64-bit mode. */ +#define UX_THREAD_EXTENSION_PTR_SET(a, b) { \ + TX_THREAD *thread_ptr; \ + thread_ptr = (TX_THREAD *) (a); \ + (thread_ptr -> tx_thread_extension_ptr) = (VOID *)(b); \ + } +#define UX_THREAD_EXTENSION_PTR_GET(a, b, c) { \ + UX_PARAMETER_NOT_USED(c); \ + TX_THREAD *thread_ptr; \ + thread_ptr = tx_thread_identify(); \ + (a) = (b *)(thread_ptr -> tx_thread_extension_ptr); \ + } + +#define UX_TIMER_EXTENSION_PTR_SET(a, b) { \ + TX_TIMER *timer_ptr; \ + timer_ptr = (TX_TIMER *) (a); \ + (timer_ptr -> tx_timer_internal.tx_timer_internal_extension_ptr) = (VOID *)(b); \ + } +#define UX_TIMER_EXTENSION_PTR_GET(a, b, c) { \ + UX_PARAMETER_NOT_USED(c); \ + if (!_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr) \ + return; \ + (a) = (b *)(_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr); \ + } + +#define UX_MEDIA_RESERVED_FOR_USER_PTR_SET(a, b) (a) -> fx_media_reserved_for_user_extension_ptr = (VOID *)(b); +#define UX_MEDIA_RESERVED_FOR_USER_PTR_GET(a, b, c) (a) = (b *)(c -> fx_media_reserved_for_user_extension_ptr); + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a7/gnu/inc/ux_port.h b/ports/cortex_a7/gnu/inc/ux_port.h new file mode 100644 index 0000000..0efe0c9 --- /dev/null +++ b/ports/cortex_a7/gnu/inc/ux_port.h @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A7/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + +/* Define memory barrier instruction. */ + +#define UX_DATA_MEMORY_BARRIER __asm__ __volatile__("DMB"); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a7/iar/inc/ux_port.h b/ports/cortex_a7/iar/inc/ux_port.h new file mode 100644 index 0000000..c63ec1f --- /dev/null +++ b/ports/cortex_a7/iar/inc/ux_port.h @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A7/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + +/* Define memory barrier instruction. */ + +#define UX_DATA_MEMORY_BARRIER __asm volatile("DMB"); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a8/gnu/inc/ux_port.h b/ports/cortex_a8/gnu/inc/ux_port.h new file mode 100644 index 0000000..ad3bea5 --- /dev/null +++ b/ports/cortex_a8/gnu/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A8/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a8/iar/inc/ux_port.h b/ports/cortex_a8/iar/inc/ux_port.h new file mode 100644 index 0000000..6521fa8 --- /dev/null +++ b/ports/cortex_a8/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-A8/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a9/gnu/inc/ux_port.h b/ports/cortex_a9/gnu/inc/ux_port.h new file mode 100644 index 0000000..d1eed79 --- /dev/null +++ b/ports/cortex_a9/gnu/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h ARM9/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_a9/iar/inc/ux_port.h b/ports/cortex_a9/iar/inc/ux_port.h new file mode 100644 index 0000000..8de41e2 --- /dev/null +++ b/ports/cortex_a9/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h ARM9/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_m0/iar/inc/ux_port.h b/ports/cortex_m0/iar/inc/ux_port.h new file mode 100644 index 0000000..5b9e7ce --- /dev/null +++ b/ports/cortex_m0/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-M0/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 1 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 1 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 1 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 1 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 70 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 16 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 0 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 1 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 1 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 2048 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_m3/iar/inc/ux_port.h b/ports/cortex_m3/iar/inc/ux_port.h new file mode 100644 index 0000000..7f8f383 --- /dev/null +++ b/ports/cortex_m3/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-M3/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 2 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 2 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 1 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 2 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 2 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 1 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 1 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 2048 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_m4/iar/inc/ux_port.h b/ports/cortex_m4/iar/inc/ux_port.h new file mode 100644 index 0000000..fb4f6d5 --- /dev/null +++ b/ports/cortex_m4/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-M4/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 2 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 2 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 8 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 2 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 2048 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_m7/iar/inc/ux_port.h b/ports/cortex_m7/iar/inc/ux_port.h new file mode 100644 index 0000000..9a104cb --- /dev/null +++ b/ports/cortex_m7/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-M7/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 4 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 16 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 2 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_r4/gnu/inc/ux_port.h b/ports/cortex_r4/gnu/inc/ux_port.h new file mode 100644 index 0000000..b874903 --- /dev/null +++ b/ports/cortex_r4/gnu/inc/ux_port.h @@ -0,0 +1,215 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-R4/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_r4/iar/inc/ux_port.h b/ports/cortex_r4/iar/inc/ux_port.h new file mode 100644 index 0000000..15183a1 --- /dev/null +++ b/ports/cortex_r4/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-R4/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_r5/gnu/inc/ux_port.h b/ports/cortex_r5/gnu/inc/ux_port.h new file mode 100644 index 0000000..d9fab7c --- /dev/null +++ b/ports/cortex_r5/gnu/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-R5/GNU */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + diff --git a/ports/cortex_r5/iar/inc/ux_port.h b/ports/cortex_r5/iar/inc/ux_port.h new file mode 100644 index 0000000..bfbcc7e --- /dev/null +++ b/ports/cortex_r5/iar/inc/ux_port.h @@ -0,0 +1,219 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* ux_port.h Cortex-R5/IAR */ +/* 6.0.1 */ +/* */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make USBX function */ +/* identically on a variety of different processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* */ +/**************************************************************************/ + +#ifndef UX_PORT_H +#define UX_PORT_H + + +/* Determine if the optional USBX user define file should be used. */ + +#ifdef UX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in ux_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "ux_user.h" +#endif + + +/* Include library header files. */ + +#include <stdio.h> +#include <string.h> + + +/* CPU definition for X86 systems without preemptive timer function. + This will make USBX uses the controller for the timer. */ + +#undef THREADX_X86_NO_PTIMER + + +/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ + + +/* Define additional generic USBX types. */ + +typedef long SLONG; + + +/* Generic USBX Project constants follow. */ + +#ifndef UX_PERIODIC_RATE +#define UX_PERIODIC_RATE 100 +#endif + +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER 8 +#endif + +#ifndef UX_MAX_SLAVE_CLASS_DRIVER +#define UX_MAX_SLAVE_CLASS_DRIVER 3 +#endif + +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 8 +#endif + +#ifndef UX_MAX_ED +#define UX_MAX_ED 80 +#endif + +#ifndef UX_MAX_TD +#define UX_MAX_TD 32 +#endif + +#ifndef UX_MAX_ISO_TD +#define UX_MAX_ISO_TD 128 +#endif + +#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE +#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) +#endif + +#ifndef UX_THREAD_STACK_SIZE +#define UX_THREAD_STACK_SIZE (1*1024) +#endif + +#ifndef UX_THREAD_PRIORITY_ENUM +#define UX_THREAD_PRIORITY_ENUM 20 +#endif + +#ifndef UX_THREAD_PRIORITY_CLASS +#define UX_THREAD_PRIORITY_CLASS 20 +#endif + +#ifndef UX_THREAD_PRIORITY_KEYBOARD +#define UX_THREAD_PRIORITY_KEYBOARD 20 +#endif + +#ifndef UX_THREAD_PRIORITY_HCD +#define UX_THREAD_PRIORITY_HCD 2 +#endif + +#ifndef UX_THREAD_PRIORITY_DCD +#define UX_THREAD_PRIORITY_DCD 2 +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE 0 +#endif + +#ifndef UX_MAX_SLAVE_LUN +#define UX_MAX_SLAVE_LUN 2 +#endif + +#ifndef UX_MAX_HOST_LUN +#define UX_MAX_HOST_LUN 8 +#endif + +#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA +#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 +#endif + +#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH +#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 +#endif + + +#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH +#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096 +#endif + +#ifndef UX_USE_IO_INSTRUCTIONS + +/* Don't use IO instructions if this define is not set. Default to memory mapped. */ + +#define inpb(a) *((UCHAR *) (a)) +#define inpw(a) *((USHORT *) (a)) +#define inpl(a) *((ULONG *) (a)) +#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) +#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) +#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) +#else + + +/* Define simple prototypes for non-memory mapped hardware access. */ + +UCHAR inpb(ULONG); +USHORT inpw(ULONG); +ULONG inpl(ULONG); + +VOID outpb(ULONG,UCHAR); +VOID outpw(ULONG,USHORT); +VOID outpl(ULONG,ULONG); + +#endif +/* Define local delay function for board specific bsps. */ +#ifdef TI_AM335 + #define UX_BSP_SPECIFIC_DELAY_FUNCTION +#endif + + +/* Define interrupt lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; +#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); +#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); + + +/* Define the version ID of USBX. This may be utilized by the application. */ + +#ifdef UX_SYSTEM_INIT +CHAR _ux_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.0.1 *"; +#else +extern CHAR _ux_version_id[]; +#endif + +#endif + |
