From ccb8db5ea17387601e6e22d7aed00c73b45f5b94 Mon Sep 17 00:00:00 2001
From: Kevin O'Connor <kevin@koconnor.net>
Date: Wed, 21 Aug 2019 21:18:44 -0400
Subject: [PATCH] lib: No need to make lpc176x SystemInit() externally visible

Now that the lpc176x code uses the armcm_boot mechanism, it is no
longer necessary for SystemInit to be externally visible.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
 lib/README                          | 5 ++---
 lib/lpc176x/device/system_LPC17xx.c | 2 +-
 lib/lpc176x/lpc176x.patch           | 9 ---------
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/lib/README b/lib/README
index d78af6d76..bbf09680d 100644
--- a/lib/README
+++ b/lib/README
@@ -35,9 +35,8 @@ The lpc176x directory contains code from the mbed project:
   https://github.com/ARMmbed/mbed-os
 version mbed-os-5.8.3 (c05d72c3c005fbb7e92c3994c32bda45218ae7fe).
 Contents taken from the targets/TARGET_NXP/TARGET_LPC176X/ directory.
-It has been modified to compile with gcc's LTO feature and to use
-appropriate clock speeds on the LPC1768 and LPC1769. See lpc176x.patch
-for the modifications.
+It has been modified to set the appropriate clock speeds on the
+LPC1768 and LPC1769. See lpc176x.patch for the modifications.
 
 The cmsis-stm32f0 and the hal-stm32f0 directories contain code from
 STMicroelectronics:
diff --git a/lib/lpc176x/device/system_LPC17xx.c b/lib/lpc176x/device/system_LPC17xx.c
index 10fa43da9..c4e56121b 100644
--- a/lib/lpc176x/device/system_LPC17xx.c
+++ b/lib/lpc176x/device/system_LPC17xx.c
@@ -511,7 +511,7 @@ uint32_t SystemCoreClock = __CORE_CLK;/*!< System Clock Frequency (Core Clock)*/
  * @brief  Setup the microcontroller system.
  *         Initialize the System.
  */
-void __attribute__((externally_visible)) SystemInit (void)
+void SystemInit (void)
 {
 #if (CLOCK_SETUP)                       /* Clock Setup                        */
   LPC_SC->SCS       = SCS_Val;
diff --git a/lib/lpc176x/lpc176x.patch b/lib/lpc176x/lpc176x.patch
index f8995d3f9..00babe91e 100644
--- a/lib/lpc176x/lpc176x.patch
+++ b/lib/lpc176x/lpc176x.patch
@@ -28,12 +28,3 @@
  
  #define PCLKSEL0_Val          0x00000000
  #define PCLKSEL1_Val          0x00000000
-@@ -514,7 +511,7 @@
-  * @brief  Setup the microcontroller system.
-  *         Initialize the System.
-  */
--void SystemInit (void)
-+void __attribute__((externally_visible)) SystemInit (void)
- {
- #if (CLOCK_SETUP)                       /* Clock Setup                        */
-   LPC_SC->SCS       = SCS_Val;