summaryrefslogtreecommitdiffstats
path: root/c/src/libchip/rtc
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /c/src/libchip/rtc
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'c/src/libchip/rtc')
-rw-r--r--c/src/libchip/rtc/ds1375-rtc.h99
-rw-r--r--c/src/libchip/rtc/icm7170.h97
-rw-r--r--c/src/libchip/rtc/m48t08.h87
-rw-r--r--c/src/libchip/rtc/mc146818a.h68
-rw-r--r--c/src/libchip/rtc/rtc.h80
5 files changed, 0 insertions, 431 deletions
diff --git a/c/src/libchip/rtc/ds1375-rtc.h b/c/src/libchip/rtc/ds1375-rtc.h
deleted file mode 100644
index a5be96293f..0000000000
--- a/c/src/libchip/rtc/ds1375-rtc.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef DS1375_I2C_RTC_H
-#define DS1375_I2C_RTC_H
-
-/* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */
-
-/*
- * Authorship
- * ----------
- * This software was created by
- *
- * Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
- * Stanford Linear Accelerator Center, Stanford University.
- *
- * Acknowledgement of sponsorship
- * ------------------------------
- * The software was produced by
- * the Stanford Linear Accelerator Center, Stanford University,
- * under Contract DE-AC03-76SFO0515 with the Department of Energy.
- *
- * Government disclaimer of liability
- * ----------------------------------
- * Neither the United States nor the United States Department of Energy,
- * nor any of their employees, makes any warranty, express or implied, or
- * assumes any legal liability or responsibility for the accuracy,
- * completeness, or usefulness of any data, apparatus, product, or process
- * disclosed, or represents that its use would not infringe privately owned
- * rights.
- *
- * Stanford disclaimer of liability
- * --------------------------------
- * Stanford University makes no representations or warranties, express or
- * implied, nor assumes any liability for the use of this software.
- *
- * Stanford disclaimer of copyright
- * --------------------------------
- * Stanford University, owner of the copyright, hereby disclaims its
- * copyright and all other rights in this software. Hence, anyone may
- * freely use it for any purpose without restriction.
- *
- * Maintenance of notices
- * ----------------------
- * In the interest of clarity regarding the origin and status of this
- * SLAC software, this and all the preceding Stanford University notices
- * are to remain affixed to any copy or derivative of this software made
- * or distributed by the recipient and are to be affixed to any copy of
- * software made or distributed by the recipient that contains a copy or
- * derivative of this software.
- *
- * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
- */
-
-#include <rtems.h>
-#include <libchip/rtc.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern rtc_fns rtc_ds1375_fns;
-
-bool
-rtc_ds1375_device_probe( int minor );
-
-uint32_t
-rtc_ds1375_get_register( uintptr_t port, uint8_t reg );
-
-void
-rtc_ds1375_set_register( uintptr_t port, uint8_t reg, uint32_t value );
-
-/*
- * BSP must supply string constant argument 'i2cname' which matches
- * the registered device name of the raw i2c device (created with mknod).
- * E.g., "/dev/i2c.ds1375-raw"
- *
- * NOTE: The i2c bus driver must already be up and 'i2cname' already
- * be available when this ENTRY is registered or initialized.
- *
- * If you want to allow applications to add the RTC driver to
- * the configuration table then the i2c subsystem must be
- * initialized by the BSP from the predriver_hook.
- */
-#define DS1375_RTC_TBL_ENTRY(i2cname) \
-{ \
- sDeviceName: "/dev/rtc", \
- deviceType: RTC_CUSTOM, \
- pDeviceFns: &rtc_ds1375_fns, \
- deviceProbe: rtc_ds1375_device_probe, \
- ulCtrlPort1: (uintptr_t)(i2cname), \
- ulDataPort: 0, \
- getRegister: rtc_ds1375_get_register, \
- setRegister: rtc_ds1375_set_register, \
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/libchip/rtc/icm7170.h b/c/src/libchip/rtc/icm7170.h
deleted file mode 100644
index 6b95c905a4..0000000000
--- a/c/src/libchip/rtc/icm7170.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Harris Semiconduction ICM7170
- *
- * 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.
- */
-
-#ifndef __LIBCHIP_ICM7170_h
-#define __LIBCHIP_ICM7170_h
-
-/*
- * Register indices
- */
-
-#define ICM7170_CONTROL 0x11
-
-
-#define ICM7170_COUNTER_HUNDREDTHS 0x00
-#define ICM7170_HOUR 0x01
-#define ICM7170_MINUTE 0x02
-#define ICM7170_SECOND 0x03
-#define ICM7170_MONTH 0x04
-#define ICM7170_DATE 0x05
-#define ICM7170_YEAR 0x06
-#define ICM7170_DAY_OF_WEEK 0x07
-
-/*
- * Configuration information in the parameters field
- */
-
-#define ICM7170_AT_32_KHZ 0x00
-#define ICM7170_AT_1_MHZ 0x01
-#define ICM7170_AT_2_MHZ 0x02
-#define ICM7170_AT_4_MHZ 0x03
-
-/*
- * Driver function table
- */
-
-extern rtc_fns icm7170_fns;
-
-/*
- * Default register access routines
- */
-
-uint32_t icm7170_get_register( /* registers are at 1 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void icm7170_set_register(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t icm7170_get_register_2( /* registers are at 2 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void icm7170_set_register_2(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t icm7170_get_register_4( /* registers are at 4 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void icm7170_set_register_4(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t icm7170_get_register_8( /* registers are at 8 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void icm7170_set_register_8(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/m48t08.h b/c/src/libchip/rtc/m48t08.h
deleted file mode 100644
index 3c46d384d5..0000000000
--- a/c/src/libchip/rtc/m48t08.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Mostek M48T08
- * + Mostek M48T18
- * + Dallas Semiconductor DS1643
- *
- * 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.
- */
-
-#ifndef __LIBCHIP_M48T08_h
-#define __LIBCHIP_M48T08_h
-
-/*
- * Register indices
- */
-
-#define M48T08_CONTROL 0
-#define M48T08_SECOND 1
-#define M48T08_MINUTE 2
-#define M48T08_HOUR 3
-#define M48T08_DAY_OF_WEEK 4
-#define M48T08_DATE 5
-#define M48T08_MONTH 6
-#define M48T08_YEAR 7
-
-/*
- * Driver function table
- */
-
-extern rtc_fns m48t08_fns;
-
-/*
- * Default register access routines
- */
-
-uint32_t m48t08_get_register( /* registers are at 1 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void m48t08_set_register(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t m48t08_get_register_2( /* registers are at 2 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void m48t08_set_register_2(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t m48t08_get_register_4( /* registers are at 4 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void m48t08_set_register_4(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-uint32_t m48t08_get_register_8( /* registers are at 8 byte boundaries */
- uintptr_t ulCtrlPort, /* and accessed as bytes */
- uint8_t ucRegNum
-);
-
-void m48t08_set_register_8(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/mc146818a.h b/c/src/libchip/rtc/mc146818a.h
deleted file mode 100644
index 4eb5af04d7..0000000000
--- a/c/src/libchip/rtc/mc146818a.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file contains the definitions for the following real-time clocks:
- *
- * + Motorola MC146818A
- *
- * 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.
- */
-
-#ifndef __LIBCHIP_MC146818A_h
-#define __LIBCHIP_MC146818A_h
-
-/*
- * Register addresses within chip
- */
-#define MC146818A_SEC 0x00 /* seconds */
-#define MC146818A_SECALRM 0x01 /* seconds alarm */
-#define MC146818A_MIN 0x02 /* minutes */
-#define MC146818A_MINALRM 0x03 /* minutes alarm */
-#define MC146818A_HRS 0x04 /* hours */
-#define MC146818A_HRSALRM 0x05 /* hours alarm */
-#define MC146818A_WDAY 0x06 /* week day */
-#define MC146818A_DAY 0x07 /* day of month */
-#define MC146818A_MONTH 0x08 /* month of year */
-#define MC146818A_YEAR 0x09 /* month of year */
-
-#define MC146818A_STATUSA 0x0a /* status register A */
-#define MC146818ASA_TUP 0x80 /* time update in progress */
-#define MC146818ASA_DIVIDER 0x20 /* divider for 32768 crystal */
-#define MC146818ASA_1024 0x06 /* divide to 1024 Hz */
-
-#define MC146818A_STATUSB 0x0b /* status register B */
-#define MC146818ASB_DST 0x01 /* Daylight Savings Time */
-#define MC146818ASB_24HR 0x02 /* 0 = 12 hours, 1 = 24 hours */
-#define MC146818ASB_HALT 0x80 /* stop clock updates */
-
-#define MC146818A_STATUSD 0x0d /* status register D */
-#define MC146818ASD_PWR 0x80 /* clock lost power */
-
-
-/*
- * Driver function table
- */
-extern rtc_fns mc146818a_fns;
-bool mc146818a_probe(
- int minor
-);
-
-/*
- * Default register access routines
- */
-uint32_t mc146818a_get_register(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum
-);
-
-void mc146818a_set_register(
- uintptr_t ulCtrlPort,
- uint8_t ucRegNum,
- uint32_t ucData
-);
-
-#endif
-/* end of include file */
diff --git a/c/src/libchip/rtc/rtc.h b/c/src/libchip/rtc/rtc.h
deleted file mode 100644
index 49dd51c2e2..0000000000
--- a/c/src/libchip/rtc/rtc.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __LIBCHIP_RTC_h
-#define __LIBCHIP_RTC_h
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#include <rtems.h>
-
-/*
- * Types for get and set register routines
- */
-
-typedef uint32_t (*getRegister_f)(uintptr_t port, uint8_t reg);
-typedef void (*setRegister_f)(uintptr_t port, uint8_t reg, uint32_t value);
-
-typedef struct _rtc_fns {
- void (*deviceInitialize)(int minor);
- int (*deviceGetTime)(int minor, rtems_time_of_day *time);
- int (*deviceSetTime)(int minor, const rtems_time_of_day *time);
-} rtc_fns;
-
-typedef enum {
- RTC_M48T08, /* SGS-Thomsom M48T08 or M48T18 */
- RTC_ICM7170, /* Harris ICM-7170 */
- RTC_CUSTOM, /* BSP specific driver */
- RTC_MC146818A /* Motorola MC146818A */
-} rtc_devs;
-
-/*
- * Each field is interpreted thus:
- *
- * sDeviceName This is the name of the device.
- *
- * deviceType This indicates the chip type.
- *
- * pDeviceFns This is a pointer to the set of driver routines to use.
- *
- * pDeviceParams This contains either device specific data or a pointer to a
- * device specific information table.
- *
- * ulCtrlPort1 This is the primary control port number for the device.
- *
- * ulDataPort This is the port number for the data port of the device
- *
- * getRegister This is the routine used to read register values.
- *
- * setRegister This is the routine used to write register values.
- */
-
-typedef struct _rtc_tbl {
- const char *sDeviceName;
- rtc_devs deviceType;
- const rtc_fns *pDeviceFns;
- bool (*deviceProbe)(int minor);
- void *pDeviceParams;
- uintptr_t ulCtrlPort1;
- uintptr_t ulDataPort;
- getRegister_f getRegister;
- setRegister_f setRegister;
-} rtc_tbl;
-
-extern rtc_tbl RTC_Table[];
-extern size_t RTC_Count;
-
-
-extern bool rtc_probe( int minor );
-
-#endif
-/* end of include file */