Squashed 'third_party/pico-sdk/lib/tinyusb/' content from commit 868948f67c

Change-Id: I5d33c2566dd597be9d4b1c30d4b3723c5ef4a265
git-subtree-dir: third_party/pico-sdk/lib/tinyusb
git-subtree-split: 868948f67c90fa7c2553cdcd604b52862cf55720
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.h b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.h
new file mode 100644
index 0000000..5732056
--- /dev/null
+++ b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.h
@@ -0,0 +1,52 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define BOARD_UART            UART0
+#define BOARD_UART_PORT       GPIOA
+
+#define BOARD_BTN_PORT        GPIOF
+#define BOARD_BTN             4
+#define BOARD_BTN_Msk         (1u<<4)
+#define BUTTON_STATE_ACTIVE   0
+
+#define LED_PORT              GPIOF
+#define LED_PIN_RED           1
+#define LED_PIN_BLUE          2
+#define LED_PIN_GREEN         3
+#define LED_STATE_ON          1
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif
diff --git a/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.mk b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.mk
new file mode 100644
index 0000000..d60365d
--- /dev/null
+++ b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/board.mk
@@ -0,0 +1,11 @@
+CFLAGS += -DTM4C123GH6PM
+ 
+LD_FILE = $(BOARD_PATH)/tm4c123.ld
+
+# For flash-jlink target
+JLINK_DEVICE = TM4C123GH6PM
+
+# flash using openocd
+OPENOCD_OPTION = -f board/ti_ek-tm4c123gxl.cfg
+
+flash: flash-openocd
diff --git a/hw/bsp/tm4c123/boards/ek-tm4c123gxl/tm4c123.ld b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/tm4c123.ld
new file mode 100644
index 0000000..e2720a9
--- /dev/null
+++ b/hw/bsp/tm4c123/boards/ek-tm4c123gxl/tm4c123.ld
@@ -0,0 +1,65 @@
+ENTRY(Reset_Handler)
+
+_estack = 0x20008000;    /* end of RAM */
+/* Generate a link error if heap and stack don't fit into RAM */
+_Min_Heap_Size = 0;      /* required amount of heap  */
+_Min_Stack_Size = 0x1000; /* required amount of stack */
+
+
+MEMORY 
+{
+    FLASH(rx) : ORIGIN = 0x00000000, LENGTH = 256K
+    SRAM(rwx) : ORIGIN = 0x20000000, LENGTH = 32K
+}
+
+SECTIONS 
+{
+    .text : 
+    {
+        . = ALIGN(4) ;
+        *(.vectors) 
+        *(.text) 
+        *(.text.*)
+        *(.init)
+        *(.fini)
+        *(.rodata)
+        *(.rodata.*)
+        . = ALIGN(4) ; 
+        __end_text = . ; 
+    } >FLASH
+    
+    .data : AT(ADDR(.text) + SIZEOF(.text))
+    {
+        . = ALIGN(4);
+        __start_data = . ; 
+        __la_data = LOADADDR(.data);
+        *(.data) 
+        *(.data.*)
+        . = ALIGN(4);
+        __end_data = . ; 
+
+    } >SRAM
+
+    .bss :
+    {
+        . = ALIGN(4) ;
+        __start_bss = . ;
+        __bss_start__ = __start_bss;
+        *(.bss)
+        *(.bss.*)
+        *(.COMMON) 
+        __end_bss = . ;
+        . = ALIGN(4);
+    }>SRAM
+
+  /* User_heap_stack section, used to check that there is enough RAM left */
+  ._user_heap_stack :
+  {
+    . = ALIGN(8);
+    PROVIDE ( end = . );
+    PROVIDE ( _end = . );
+    . = . + _Min_Heap_Size;
+    . = . + _Min_Stack_Size;
+    . = ALIGN(8);
+  } >SRAM
+}