summaryrefslogtreecommitdiffstats
path: root/bsps/include/libchip
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/include/libchip')
-rw-r--r--bsps/include/libchip/disp_hcms29xx.h27
-rw-r--r--bsps/include/libchip/greth.h152
-rw-r--r--bsps/include/libchip/i2c-sc620.h27
-rw-r--r--bsps/include/libchip/icm7170.h25
-rw-r--r--bsps/include/libchip/m48t08.h25
-rw-r--r--bsps/include/libchip/mc146818a.h25
-rw-r--r--bsps/include/libchip/mc68681.h25
-rw-r--r--bsps/include/libchip/mcp7940m-rtc.h103
-rw-r--r--bsps/include/libchip/rtc.h25
-rw-r--r--bsps/include/libchip/serial.h25
-rw-r--r--bsps/include/libchip/spi-flash-m25p40.h27
-rw-r--r--bsps/include/libchip/spi-fram-fm25l256.h27
-rw-r--r--bsps/include/libchip/spi-memdrv.h27
-rw-r--r--bsps/include/libchip/spi-sd-card.h27
14 files changed, 373 insertions, 194 deletions
diff --git a/bsps/include/libchip/disp_hcms29xx.h b/bsps/include/libchip/disp_hcms29xx.h
index a7053177c6..adb47dd9d8 100644
--- a/bsps/include/libchip/disp_hcms29xx.h
+++ b/bsps/include/libchip/disp_hcms29xx.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* Display driver for HCMS29xx
*
@@ -6,11 +8,28 @@
*/
/*
- * Copyright (c) 2008 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2008 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DISP_HCMS29XX_H
diff --git a/bsps/include/libchip/greth.h b/bsps/include/libchip/greth.h
deleted file mode 100644
index c6e000dbd3..0000000000
--- a/bsps/include/libchip/greth.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Gaisler Research ethernet MAC driver
- * adapted from Opencores driver by Marko Isomaki
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-
-#ifndef _GR_ETH_
-#define _GR_ETH_
-
-
-/* Configuration Information */
-
-typedef struct {
- void *base_address;
- rtems_vector_number vector;
- uint32_t txd_count;
- uint32_t rxd_count;
-} greth_configuration_t;
-
-/* Ethernet configuration registers */
-
-typedef struct _greth_regs {
- volatile uint32_t ctrl; /* Ctrl Register */
- volatile uint32_t status; /* Status Register */
- volatile uint32_t mac_addr_msb; /* Bit 47-32 of MAC address */
- volatile uint32_t mac_addr_lsb; /* Bit 31-0 of MAC address */
- volatile uint32_t mdio_ctrl; /* MDIO control and status */
- volatile uint32_t txdesc; /* Transmit descriptor pointer */
- volatile uint32_t rxdesc; /* Receive descriptor pointer */
-} greth_regs;
-
-#define GRETH_TOTAL_BD 128
-#define GRETH_MAXBUF_LEN 1520
-
-/* Tx BD */
-#define GRETH_TXD_ENABLE 0x0800 /* Tx BD Enable */
-#define GRETH_TXD_WRAP 0x1000 /* Tx BD Wrap (last BD) */
-#define GRETH_TXD_IRQ 0x2000 /* Tx BD IRQ Enable */
-#define GRETH_TXD_MORE 0x20000 /* Tx BD More (more descs for packet) */
-#define GRETH_TXD_IPCS 0x40000 /* Tx BD insert ip chksum */
-#define GRETH_TXD_TCPCS 0x80000 /* Tx BD insert tcp chksum */
-#define GRETH_TXD_UDPCS 0x100000 /* Tx BD insert udp chksum */
-
-#define GRETH_TXD_UNDERRUN 0x4000 /* Tx BD Underrun Status */
-#define GRETH_TXD_RETLIM 0x8000 /* Tx BD Retransmission Limit Status */
-#define GRETH_TXD_LATECOL 0x10000 /* Tx BD Late Collision */
-
-#define GRETH_TXD_STATS (GRETH_TXD_UNDERRUN | \
- GRETH_TXD_RETLIM | \
- GRETH_TXD_LATECOL)
-
-#define GRETH_TXD_CS (GRETH_TXD_IPCS | \
- GRETH_TXD_TCPCS | \
- GRETH_TXD_UDPCS)
-
-/* Rx BD */
-#define GRETH_RXD_ENABLE 0x0800 /* Rx BD Enable */
-#define GRETH_RXD_WRAP 0x1000 /* Rx BD Wrap (last BD) */
-#define GRETH_RXD_IRQ 0x2000 /* Rx BD IRQ Enable */
-
-#define GRETH_RXD_DRIBBLE 0x4000 /* Rx BD Dribble Nibble Status */
-#define GRETH_RXD_TOOLONG 0x8000 /* Rx BD Too Long Status */
-#define GRETH_RXD_CRCERR 0x10000 /* Rx BD CRC Error Status */
-#define GRETH_RXD_OVERRUN 0x20000 /* Rx BD Overrun Status */
-#define GRETH_RXD_LENERR 0x40000 /* Rx BD Length Error */
-#define GRETH_RXD_ID 0x40000 /* Rx BD IP Detected */
-#define GRETH_RXD_IR 0x40000 /* Rx BD IP Chksum Error */
-#define GRETH_RXD_UD 0x40000 /* Rx BD UDP Detected*/
-#define GRETH_RXD_UR 0x40000 /* Rx BD UDP Chksum Error */
-#define GRETH_RXD_TD 0x40000 /* Rx BD TCP Detected */
-#define GRETH_RXD_TR 0x40000 /* Rx BD TCP Chksum Error */
-
-
-#define GRETH_RXD_STATS (GRETH_RXD_OVERRUN | \
- GRETH_RXD_DRIBBLE | \
- GRETH_RXD_TOOLONG | \
- GRETH_RXD_CRCERR)
-
-/* CTRL Register */
-#define GRETH_CTRL_TXEN 0x00000001 /* Transmit Enable */
-#define GRETH_CTRL_RXEN 0x00000002 /* Receive Enable */
-#define GRETH_CTRL_TXIRQ 0x00000004 /* Transmit Enable */
-#define GRETH_CTRL_RXIRQ 0x00000008 /* Receive Enable */
-#define GRETH_CTRL_FULLD 0x00000010 /* Full Duplex */
-#define GRETH_CTRL_PRO 0x00000020 /* Promiscuous (receive all) */
-#define GRETH_CTRL_RST 0x00000040 /* Reset MAC */
-
-/* Status Register */
-#define GRETH_STATUS_RXERR 0x00000001 /* Receive Error */
-#define GRETH_STATUS_TXERR 0x00000002 /* Transmit Error IRQ */
-#define GRETH_STATUS_RXIRQ 0x00000004 /* Receive Frame IRQ */
-#define GRETH_STATUS_TXIRQ 0x00000008 /* Transmit Error IRQ */
-#define GRETH_STATUS_RXAHBERR 0x00000010 /* Receiver AHB Error */
-#define GRETH_STATUS_TXAHBERR 0x00000020 /* Transmitter AHB Error */
-
-/* MDIO Control */
-#define GRETH_MDIO_WRITE 0x00000001 /* MDIO Write */
-#define GRETH_MDIO_READ 0x00000002 /* MDIO Read */
-#define GRETH_MDIO_LINKFAIL 0x00000004 /* MDIO Link failed */
-#define GRETH_MDIO_BUSY 0x00000008 /* MDIO Link Busy */
-#define GRETH_MDIO_REGADR 0x000007C0 /* Register Address */
-#define GRETH_MDIO_PHYADR 0x0000F800 /* PHY address */
-#define GRETH_MDIO_DATA 0xFFFF0000 /* MDIO DATA */
-
-
-/* MII registers */
-#define GRETH_MII_EXTADV_1000FD 0x00000200
-#define GRETH_MII_EXTADV_1000HD 0x00000100
-#define GRETH_MII_EXTPRT_1000FD 0x00000800
-#define GRETH_MII_EXTPRT_1000HD 0x00000400
-
-#define GRETH_MII_100T4 0x00000200
-#define GRETH_MII_100TXFD 0x00000100
-#define GRETH_MII_100TXHD 0x00000080
-#define GRETH_MII_10FD 0x00000040
-#define GRETH_MII_10HD 0x00000020
-
-
-
-/* Attach routine */
-
-int rtems_greth_driver_attach (
- struct rtems_bsdnet_ifconfig *config,
- greth_configuration_t *chip
-);
-
-/* PHY data */
-struct phy_device_info
-{
- int vendor;
- int device;
- int rev;
-
- int adv;
- int part;
-
- int extadv;
- int extpart;
-};
-
-/*
-#ifdef CPU_U32_FIX
-void ipalign(struct mbuf *m);
-#endif
-
-*/
-#endif
-
diff --git a/bsps/include/libchip/i2c-sc620.h b/bsps/include/libchip/i2c-sc620.h
index e8326de881..f232396dfe 100644
--- a/bsps/include/libchip/i2c-sc620.h
+++ b/bsps/include/libchip/i2c-sc620.h
@@ -1,9 +1,28 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
- * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef I2C_SC620_H
diff --git a/bsps/include/libchip/icm7170.h b/bsps/include/libchip/icm7170.h
index 6b95c905a4..d0985c43f6 100644
--- a/bsps/include/libchip/icm7170.h
+++ b/bsps/include/libchip/icm7170.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* This file contains the definitions for the following real-time clocks:
*
@@ -6,9 +8,26 @@
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LIBCHIP_ICM7170_h
diff --git a/bsps/include/libchip/m48t08.h b/bsps/include/libchip/m48t08.h
index 3c46d384d5..3effafe49f 100644
--- a/bsps/include/libchip/m48t08.h
+++ b/bsps/include/libchip/m48t08.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* This file contains the definitions for the following real-time clocks:
*
@@ -8,9 +10,26 @@
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LIBCHIP_M48T08_h
diff --git a/bsps/include/libchip/mc146818a.h b/bsps/include/libchip/mc146818a.h
index 4eb5af04d7..d12a320fd2 100644
--- a/bsps/include/libchip/mc146818a.h
+++ b/bsps/include/libchip/mc146818a.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* This file contains the definitions for the following real-time clocks:
*
@@ -6,9 +8,26 @@
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LIBCHIP_MC146818A_h
diff --git a/bsps/include/libchip/mc68681.h b/bsps/include/libchip/mc68681.h
index e498a41b30..c4bd890e0a 100644
--- a/bsps/include/libchip/mc68681.h
+++ b/bsps/include/libchip/mc68681.h
@@ -1,11 +1,30 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MC68681_H_
diff --git a/bsps/include/libchip/mcp7940m-rtc.h b/bsps/include/libchip/mcp7940m-rtc.h
new file mode 100644
index 0000000000..266400dfba
--- /dev/null
+++ b/bsps/include/libchip/mcp7940m-rtc.h
@@ -0,0 +1,103 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (C) 2023 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LIBCHIP_MCP7940M_RTC_H
+#define LIBCHIP_MCP7940M_RTC_H
+
+#include <rtems.h>
+#include <rtems/thread.h>
+#include <libchip/rtc.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+extern const rtc_fns rtc_mcp7940m_fns;
+bool rtc_mcp7940m_probe(int minor);
+
+/*
+ * It is expected, that the RTC can be accessed as a raw file. A pointer to a
+ * constant string with the name of that device has to be passed to the table
+ * initializer.
+ *
+ * The MCP7940M uses an EEPROM-like interface. So you could for example use the
+ * following initialization:
+ *
+ * Define a context for the RTC somewhere:
+ *
+ * static struct mcp7940m_rtc rtc_ctx =
+ * MCP7940M_RTC_INITIALIZER("/dev/i2c-1", 0x6F, true);
+ *
+ * Then you can use the following for the RTC_Table:
+ *
+ * MCP7940M_RTC_TBL_ENTRY("/dev/rtc", &rtc_ctx)
+ */
+
+struct mcp7940m_rtc {
+ /** Just initialize with RTEMS_MUTEX_INITIALIZER('mcp7940'). */
+ rtems_mutex mutex;
+
+ /** The path of the I2C bus device. */
+ const char *i2c_bus_path;
+
+ /** I2C address. */
+ uint8_t i2c_addr;
+
+ /** True if a crystal should be used. False if an oscillator is connected. */
+ bool crystal;
+
+ /** Whether the RTC has already been initialized. Used internally. */
+ bool initialized;
+};
+
+#define MCP7940M_RTC_INITIALIZER(i2c_path, i2c_address, has_crystal) { \
+ .mutex = RTEMS_MUTEX_INITIALIZER("mcp7940m"), \
+ .i2c_bus_path = i2c_path, \
+ .i2c_addr = i2c_address, \
+ .crystal = has_crystal, \
+ .initialized = false, \
+ }
+
+#define MCP7940M_RTC_TBL_ENTRY(dev_name, mcp7940m_rtc_ctx) \
+ { \
+ .sDeviceName = dev_name, \
+ .deviceType = RTC_CUSTOM, \
+ .pDeviceFns = &rtc_mcp7940m_fns, \
+ .deviceProbe = rtc_mcp7940m_probe, \
+ .pDeviceParams = (void *)mcp7940m_rtc_ctx, \
+ .ulCtrlPort1 = 0, \
+ .ulDataPort = 0, \
+ .getRegister = NULL, \
+ .setRegister = NULL, \
+ }
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBCHIP_MCP7940M_RTC_H */
diff --git a/bsps/include/libchip/rtc.h b/bsps/include/libchip/rtc.h
index 49dd51c2e2..02bf1cad8f 100644
--- a/bsps/include/libchip/rtc.h
+++ b/bsps/include/libchip/rtc.h
@@ -1,12 +1,31 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* This file contains the Real-Time Clock definitions.
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LIBCHIP_RTC_h
diff --git a/bsps/include/libchip/serial.h b/bsps/include/libchip/serial.h
index 49a7bebdca..eef072eb6a 100644
--- a/bsps/include/libchip/serial.h
+++ b/bsps/include/libchip/serial.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -13,9 +15,26 @@
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __LIBCHIP_SERIAL_h
diff --git a/bsps/include/libchip/spi-flash-m25p40.h b/bsps/include/libchip/spi-flash-m25p40.h
index fdd11f8ecf..c64109515c 100644
--- a/bsps/include/libchip/spi-flash-m25p40.h
+++ b/bsps/include/libchip/spi-flash-m25p40.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* SPI driver for M25P40 like spi flash device
*
@@ -6,11 +8,28 @@
*/
/*
- * Copyright (c) 2007 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2007 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LIBCHIP_SPI_FLASH_M25P40_H
diff --git a/bsps/include/libchip/spi-fram-fm25l256.h b/bsps/include/libchip/spi-fram-fm25l256.h
index a2d312d268..4251edb556 100644
--- a/bsps/include/libchip/spi-fram-fm25l256.h
+++ b/bsps/include/libchip/spi-fram-fm25l256.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* SPI driver for FM25L256 like spi fram device
*
@@ -6,11 +8,28 @@
*/
/*
- * Copyright (c) 2008 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2008 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LIBCHIP_SPI_FRAM_FM25L256_H
diff --git a/bsps/include/libchip/spi-memdrv.h b/bsps/include/libchip/spi-memdrv.h
index 04feccc3a3..d2c6a1edc1 100644
--- a/bsps/include/libchip/spi-memdrv.h
+++ b/bsps/include/libchip/spi-memdrv.h
@@ -1,13 +1,32 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
* SPI driver for spi memory devices
*/
/*
- * Copyright (c) 2008 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2008 embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LIBCHIP_SPI_MEMDRV_H
diff --git a/bsps/include/libchip/spi-sd-card.h b/bsps/include/libchip/spi-sd-card.h
index 4480823271..227ae7d58a 100644
--- a/bsps/include/libchip/spi-sd-card.h
+++ b/bsps/include/libchip/spi-sd-card.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -5,10 +7,27 @@
*/
/*
- * Copyright (c) 2008 embedded brains GmbH. All rights reserved.
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Copyright (c) 2008 embedded brains GmbH & Co. KG
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBI2C_SD_CARD_H