diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 09:55:15 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 15:18:44 +0200 |
commit | 4fb1b79a804ca8de866be0ef718e54e1f62fa3ec (patch) | |
tree | 11b85c98244db22c927e7f1323ed222c43a589b0 /c/src/lib/libbsp/powerpc | |
parent | bsps: Move legacy network drivers to bsps (diff) | |
download | rtems-4fb1b79a804ca8de866be0ef718e54e1f62fa3ec.tar.bz2 |
bsps: Move RTC drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/powerpc')
-rw-r--r-- | c/src/lib/libbsp/powerpc/beatnik/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/beatnik/tod/todcfg.c | 32 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/Makefile.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.c | 228 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.h | 99 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/tod/todcfg.c | 102 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme3100/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme3100/tod/todcfg.c | 24 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/tod/todcfg.c | 32 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/qoriq/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/qoriq/rtc/rtc-config.c | 67 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/tod/todcfg.c | 66 |
14 files changed, 7 insertions, 657 deletions
diff --git a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am index 4de5536771..e49d9915a0 100644 --- a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am +++ b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am @@ -96,7 +96,7 @@ endif # tod librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c -librtemsbsp_a_SOURCES += tod/todcfg.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/beatnik/rtc/todcfg.c librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/altivec/vec_sup.c librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/altivec/vec_sup_asm.S diff --git a/c/src/lib/libbsp/powerpc/beatnik/tod/todcfg.c b/c/src/lib/libbsp/powerpc/beatnik/tod/todcfg.c deleted file mode 100644 index e8faccc840..0000000000 --- a/c/src/lib/libbsp/powerpc/beatnik/tod/todcfg.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file contains the RTC driver table for Motorola shared BSPs. - * - * 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. - */ - -#include <bsp.h> -#include <libchip/rtc.h> -#include <libchip/m48t08.h> - -/* The following table configures the RTC drivers used in this BSP */ -rtc_tbl RTC_Table[] = { - { - "/dev/rtc", /* sDeviceName */ - RTC_M48T08, /* deviceType */ - &m48t08_fns, /* pDeviceFns */ - rtc_probe, /* deviceProbe */ - NULL, /* pDeviceParams */ - BSP_NVRAM_RTC_START, /* ulCtrlPort1 */ - 0x00, /* ulDataPort */ - m48t08_get_register, /* getRegister */ - m48t08_set_register /* setRegister */ - } -}; - -/* Some information used by the RTC driver */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -size_t RTC_Count = NUM_RTCS; diff --git a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am index f72583af21..d4801ec541 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am +++ b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am @@ -82,8 +82,8 @@ librtemsbsp_a_SOURCES += nvram/nvram.c librtemsbsp_a_SOURCES += slicetimer/slicetimer.c # tod -librtemsbsp_a_SOURCES += tod/todcfg.c -librtemsbsp_a_SOURCES += tod/pcf8563.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/gen5200/rtc/todcfg.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/gen5200/rtc/pcf8563.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c # startup diff --git a/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.c b/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.c deleted file mode 100644 index eb3d758f80..0000000000 --- a/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.c +++ /dev/null @@ -1,228 +0,0 @@ -/*===============================================================*\ -| Project: RTEMS generic MPC5200 BSP | -+-----------------------------------------------------------------+ -| Partially based on the code references which are named below. | -| Adaptions, modifications, enhancements and any recent parts of | -| the code are: | -| Copyright (c) 2005 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -+-----------------------------------------------------------------+ -| 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 file contains the tod driver for a Philips pcf8563 I2C RTC | -\*===============================================================*/ -/* - * This file interfaces with the real-time clock found in a - * Philips PCF8563 serial real-time clock chip. - * This RTC have I2C bus interface. BSP have to provide I2C bus primitives - * to make this driver working. getRegister and setRegister primitives is - * not used here to avoid multiple transactions over I2C bus (each transaction - * require significant time and error when date/time information red may - * occurs). ulControlPort contains I2C bus number; ulDataPort contains - * RTC I2C device address. - * - * Based on a ds1307 driver from: - * - * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia - * Author: Victor V. Vengerov <vvv@oktet.ru> - * - * 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. - */ - -#include <rtems.h> -#include <bsp/fatal.h> -#include <bsp/i2c.h> -#include <libchip/rtc.h> -#include <string.h> -#include "../tod/pcf8563.h" - -/* Convert from/to Binary-Coded Decimal representation */ -#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F)) -#define To_BCD( _x ) ((((_x) / 10) << 4) + ((_x) % 10)) - -/* pcf8563_initialize -- - * Initialize PCF8563 real-time clock chip. If RTC is halted, this - * function resume counting. - * - * PARAMETERS: - * minor -- minor RTC device number - */ -static void -pcf8563_initialize(int minor) -{ - i2c_message_status status; - int try; - uint8_t ctrl1; - i2c_bus_number bus; - i2c_address addr; - - bus = RTC_Table[minor].ulCtrlPort1; - addr = RTC_Table[minor].ulDataPort; - - /* Read SECONDS register */ - try = 0; - do { - status = i2c_wbrd(bus, addr, PCF8563_CONTROL1_ADR, - &ctrl1, sizeof(ctrl1)); - try++; - } while ((status != I2C_SUCCESSFUL) && (try < 15)); - - /* If clock is halted, reset and start the clock */ - if ((ctrl1 & PCF8563_CONTROL1_STOP) != 0) - { - uint8_t start[8]; - memset(start, 0, sizeof(start)); - start[0] = PCF8563_CONTROL1_ADR; - try = 0; - do { - status = i2c_write(bus, addr, start, 2); - } while ((status != I2C_SUCCESSFUL) && (try < 15)); - } -} - -/* pcf8563_get_time -- - * read current time from PCF8563 real-time clock chip and convert it - * to the rtems_time_of_day structure. - * - * PARAMETERS: - * minor -- minor RTC device number - * time -- place to put return value (date and time) - * - * RETURNS: - * 0, if time obtained successfully - * -1, if error occured - */ -static int -pcf8563_get_time(int minor, rtems_time_of_day *time) -{ - i2c_bus_number bus; - i2c_address addr; - uint8_t info[10]; - uint32_t v1, v2; - i2c_message_status status; - int try; - - if (time == NULL) - return -1; - - bus = RTC_Table[minor].ulCtrlPort1; - addr = RTC_Table[minor].ulDataPort; - - memset(time, 0, sizeof(rtems_time_of_day)); - try = 0; - do { - status = i2c_wbrd(bus, addr, PCF8563_SECOND_ADR, info, sizeof(info)); - try++; - } while ((status != I2C_SUCCESSFUL) && (try < 10)); - - if (status != I2C_SUCCESSFUL) - { - return -1; - } - - v1 = info[PCF8563_YEAR_ADR-PCF8563_SECOND_ADR]; - v2 = From_BCD(v1); - if ((info[PCF8563_MONTH_ADR-PCF8563_SECOND_ADR] - & PCF8563_MONTH_CENTURY) == 0) { - time->year = 1900 + v2; - } - else { - time->year = 2000 + v2; - } - - v1 = info[PCF8563_MONTH_ADR-PCF8563_SECOND_ADR] & PCF8563_MONTH_MASK; - time->month = From_BCD(v1); - - v1 = info[PCF8563_DAY_ADR-PCF8563_SECOND_ADR] & PCF8563_DAY_MASK; - time->day = From_BCD(v1); - - v1 = info[PCF8563_HOUR_ADR-PCF8563_SECOND_ADR] & PCF8563_HOUR_MASK; - time->hour = From_BCD(v1); - - v1 = info[PCF8563_MINUTE_ADR-PCF8563_SECOND_ADR] & PCF8563_MINUTE_MASK; - time->minute = From_BCD(v1); - - v1 = info[PCF8563_SECOND_ADR-PCF8563_SECOND_ADR] & PCF8563_SECOND_MASK; - time->second = From_BCD(v1); - - return 0; -} - -/* pcf8563_set_time -- - * set time to the PCF8563 real-time clock chip - * - * PARAMETERS: - * minor -- minor RTC device number - * time -- new date and time to be written to PCF8563 - * - * RETURNS: - * 0, if time obtained successfully - * -1, if error occured - */ -static int -pcf8563_set_time(int minor, const rtems_time_of_day *time) -{ - i2c_bus_number bus; - i2c_address addr; - uint8_t info[8]; - i2c_message_status status; - int try; - - if (time == NULL) - return -1; - - bus = RTC_Table[minor].ulCtrlPort1; - addr = RTC_Table[minor].ulDataPort; - - if ((time->year >= 2100) || (time->year < 1900)) { - bsp_fatal(MPC5200_FATAL_PCF8563_INVALID_YEAR); - } - info[0] = PCF8563_SECOND_ADR; - info[1 + PCF8563_YEAR_ADR -PCF8563_SECOND_ADR] = To_BCD(time->year % 100); - info[1 + PCF8563_MONTH_ADR -PCF8563_SECOND_ADR] = To_BCD(time->month); - info[1 + PCF8563_DAY_ADR -PCF8563_SECOND_ADR] = To_BCD(time->day); - info[1 + PCF8563_HOUR_ADR -PCF8563_SECOND_ADR] = To_BCD(time->hour); - info[1 + PCF8563_MINUTE_ADR-PCF8563_SECOND_ADR] = To_BCD(time->minute); - info[1 + PCF8563_SECOND_ADR-PCF8563_SECOND_ADR] = To_BCD(time->second); - /* Do not set day of week */ - info[1 + PCF8563_DAY_OF_WEEK_ADR-PCF8563_SECOND_ADR] = 1; - - /* - * add century info - */ - if (time->year >= 2000) { - info[1 + PCF8563_MONTH_ADR -PCF8563_SECOND_ADR] |= PCF8563_MONTH_CENTURY; - } - /* - * send to device - */ - try = 0; - do { - status = i2c_write(bus, addr, info,sizeof(info)); - try++; - } while ((status != I2C_SUCCESSFUL) && (try < 10)); - - if (status != I2C_SUCCESSFUL) - return -1; - else - return 0; -} - -/* Driver function table */ - -rtc_fns pcf8563_fns = { - pcf8563_initialize, - pcf8563_get_time, - pcf8563_set_time -}; diff --git a/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.h b/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.h deleted file mode 100644 index f46b03e531..0000000000 --- a/c/src/lib/libbsp/powerpc/gen5200/tod/pcf8563.h +++ /dev/null @@ -1,99 +0,0 @@ -/*===============================================================*\ -| Project: RTEMS generic MPC5200 BSP | -+-----------------------------------------------------------------+ -| Partially based on the code references which are named below. | -| Adaptions, modifications, enhancements and any recent parts of | -| the code are: | -| Copyright (c) 2005 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -+-----------------------------------------------------------------+ -| 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 file contains declarations for the pcf8563 RTC driver | -\*===============================================================*/ -/* - * This file contains the definitions for Dallas Semiconductor - * DS1307/DS1308 serial real-time clock/NVRAM. - * - * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia - * Author: Victor V. Vengerov <vvv@oktet.ru> - * - * 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 __RTC_PCF8563__ -#define __RTC_PCF8563__ - -#define PCF8563_I2C_ADDRESS (0xA2) /* I2C bus address assigned to PCF8563 */ - -#define PCF8563_CONTROL1_ADR (0x00) -#define PCF8563_CONTROL1_TEST1 (0x80) /* EXT_CLK test mode */ -#define PCF8563_CONTROL1_STOP (0x20) /* stop RTC source clock, clear divider*/ -#define PCF8563_CONTROL1_TESTC (0x08) /* enable power-on reset override */ - /***********/ -#define PCF8563_CONTROL2_ADR (0x01) -#define PCF8563_CONTROL2_TITP (0x10) /* 0: int output is level */ -#define PCF8563_CONTROL2_AF (0x08) /* alarm flag */ -#define PCF8563_CONTROL2_TF (0x04) /* timer flag */ -#define PCF8563_CONTROL2_AIE (0x02) /* alarm interrupt enable */ -#define PCF8563_CONTROL2_TIE (0x01) /* timer interrupt enable */ - /***********/ - -#define PCF8563_SECOND_ADR (0x02) -#define PCF8563_SECOND_VL (0x80) /* clock integrity no longer guaranteed */ -#define PCF8563_SECOND_MASK (0x7f) - /***********/ - -#define PCF8563_MINUTE_ADR (0x03) -#define PCF8563_MINUTE_MASK (0x7f) - /***********/ - -#define PCF8563_HOUR_ADR (0x04) -#define PCF8563_HOUR_MASK (0x3f) - /***********/ - -#define PCF8563_DAY_ADR (0x05) -#define PCF8563_DAY_MASK (0x3f) - -#define PCF8563_DAY_OF_WEEK_ADR (0x06) -#define PCF8563_DAY_OF_WEEK_MASK (0x07) - -#define PCF8563_MONTH_ADR (0x07) -#define PCF8563_MONTH_MASK (0x1f) -#define PCF8563_MONTH_CENTURY (0x80) - /***********/ - -#define PCF8563_YEAR_ADR (0x08) -#define PCF8563_YEAR_MASK (0xff) - -#define PCF8563_MINUTE_ALARM_ADR (0x09) -#define PCF8563_HOUR_ALARM_ADR (0x0A) -#define PCF8563_DAY_ALARM_ADR (0x0B) -#define PCF8563_DAY_OF_WEEK_ALARM_ADR (0x0C) -#define PCF8563_XXX_ALARM_AE (0x80) - /***********/ - -#define PCF8563_CLKOUTCTL_ADR (0x0D) -#define PCF8563_CLKOUTCTL_FE (0x80) /* */ -#define PCF8563_CLKOUTCTL_FD (0x03) /* */ - /***********/ - -#define PCF8563_TIMERCTL_ADR (0x0E) -#define PCF8563_TIMERCTL_FE (0x80) /* */ -#define PCF8563_TIMERCTL_FD (0x03) /* */ - /***********/ - -#define PCF8563_TIMER_ADR (0x0F) - -#endif /* __RTC_PCF8563__ */ diff --git a/c/src/lib/libbsp/powerpc/gen5200/tod/todcfg.c b/c/src/lib/libbsp/powerpc/gen5200/tod/todcfg.c deleted file mode 100644 index 6db222b7f0..0000000000 --- a/c/src/lib/libbsp/powerpc/gen5200/tod/todcfg.c +++ /dev/null @@ -1,102 +0,0 @@ -/*===============================================================*\ -| Project: RTEMS generic MPC5200 BSP | -+-----------------------------------------------------------------+ -| Partially based on the code references which are named below. | -| Adaptions, modifications, enhancements and any recent parts of | -| the code are: | -| Copyright (c) 2005 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -+-----------------------------------------------------------------+ -| 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 file configures the pcf8563 RTC for a PM520 board | -\*===============================================================*/ -/* - * This file contains the RTC driver table for Motorola MCF5206eLITE - * ColdFire evaluation board. - * - * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia - * Author: Victor V. Vengerov <vvv@oktet.ru> - * - * 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. - */ - -#include <bsp.h> -#include <bsp/i2c.h> -#include <libchip/rtc.h> -#include "../tod/pcf8563.h" - -/* Forward function declaration */ -bool mpc5200_pcf8563_probe(int minor); - -extern rtc_fns pcf8563_fns; - -/* The following table configures the RTC drivers used in this BSP */ -rtc_tbl RTC_Table[] = { - { - "/dev/rtc", /* sDeviceName */ - RTC_CUSTOM, /* deviceType */ - &pcf8563_fns, /* pDeviceFns */ - mpc5200_pcf8563_probe, /* deviceProbe */ - NULL, /* pDeviceParams */ - 0x01, /* ulCtrlPort1, for PCF8563-I2C bus number */ - PCF8563_I2C_ADDRESS, /* ulDataPort, for PCF8563-I2C device addr */ - NULL, /* getRegister - not applicable to PCF8563 */ - NULL /* setRegister - not applicable to PCF8563 */ - } -}; - -/* Some information used by the RTC driver */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -size_t RTC_Count = NUM_RTCS; - -/* mpc5200_pcf8563_probe -- - * RTC presence probe function. Return TRUE, if device is present. - * Device presence checked by probe access to RTC device over I2C bus. - * - * PARAMETERS: - * minor - minor RTC device number - * - * RETURNS: - * TRUE, if RTC device is present - */ -bool -mpc5200_pcf8563_probe(int minor) -{ - int try = 0; - i2c_message_status status; - rtc_tbl *rtc; - i2c_bus_number bus; - i2c_address addr; - - if (minor >= NUM_RTCS) - return false; - - rtc = RTC_Table + minor; - - bus = rtc->ulCtrlPort1; - addr = rtc->ulDataPort; - do { - status = i2c_wrbyte(bus, addr, 0); - if (status == I2C_NO_DEVICE) - return false; - try++; - } while ((try < 15) && (status != I2C_SUCCESSFUL)); - if (status == I2C_SUCCESSFUL) - return true; - else - return false; -} diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am index 43bb7a7911..0ebc88d088 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am @@ -49,7 +49,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/motorola_powerpc/start/b # tod librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c -librtemsbsp_a_SOURCES += ../shared/tod/todcfg.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/rtc/todcfg.c # pclock librtemsbsp_a_SOURCES +=../../../../../../bsps/powerpc/shared/clock/p_clock.c diff --git a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am index 88b1f81212..1c3a18e51a 100644 --- a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am +++ b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am @@ -47,7 +47,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c # tod librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c -librtemsbsp_a_SOURCES += tod/todcfg.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/mvme3100/rtc/todcfg.c # pclock librtemsbsp_a_SOURCES +=../../../../../../bsps/powerpc/shared/clock/p_clock.c diff --git a/c/src/lib/libbsp/powerpc/mvme3100/tod/todcfg.c b/c/src/lib/libbsp/powerpc/mvme3100/tod/todcfg.c deleted file mode 100644 index 939bea0258..0000000000 --- a/c/src/lib/libbsp/powerpc/mvme3100/tod/todcfg.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file contains the RTC driver table for the MVME3100 BSP - * - * 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. - * - * Modified for mvme3100 by T. Straumann, 2007 - */ - -#include <bsp.h> -#include <libchip/rtc.h> -#include <libchip/ds1375-rtc.h> - -/* The following table configures the RTC drivers used in this BSP */ -rtc_tbl RTC_Table[] = { - DS1375_RTC_TBL_ENTRY(BSP_I2C_DS1375_RAW_DEV_NAME), -}; - -/* Some information used by the RTC driver */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -size_t RTC_Count = NUM_RTCS; diff --git a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am index 6344139e30..a3cfcfb7b5 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am +++ b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am @@ -44,7 +44,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/mvme5500/irq/BSP_irq.c # tod librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c -librtemsbsp_a_SOURCES += tod/todcfg.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/mvme5500/rtc/todcfg.c # vectors librtemsbsp_a_SOURCES += vectors/exceptionhandler.c diff --git a/c/src/lib/libbsp/powerpc/mvme5500/tod/todcfg.c b/c/src/lib/libbsp/powerpc/mvme5500/tod/todcfg.c deleted file mode 100644 index 39089db710..0000000000 --- a/c/src/lib/libbsp/powerpc/mvme5500/tod/todcfg.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file contains the RTC driver table for Motorola shared BSPs. - * - * 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. - */ - -#include <bsp.h> -#include <libchip/rtc.h> -#include <libchip/m48t08.h> - -/* The following table configures the RTC drivers used in this BSP */ -rtc_tbl RTC_Table[] = { - { - "/dev/rtc", /* sDeviceName */ - RTC_M48T08, /* deviceType */ - &m48t08_fns, /* pDeviceFns */ - rtc_probe, /* deviceProbe */ - NULL, /* pDeviceParams */ - 0xF1117FF8, /* ulCtrlPort1 */ - 0x00, /* ulDataPort */ - m48t08_get_register, /* getRegister */ - m48t08_set_register /* setRegister */ - } -}; - -/* Some information used by the RTC driver */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -size_t RTC_Count = NUM_RTCS; diff --git a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am index abc6e0177c..a257693a2b 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am +++ b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am @@ -73,7 +73,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qoriq/console/console-co # RTC librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c -librtemsbsp_a_SOURCES += rtc/rtc-config.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qoriq/rtc/rtc-config.c # MPCI librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qoriq/mpci/lock.S diff --git a/c/src/lib/libbsp/powerpc/qoriq/rtc/rtc-config.c b/c/src/lib/libbsp/powerpc/qoriq/rtc/rtc-config.c deleted file mode 100644 index c3e39e0830..0000000000 --- a/c/src/lib/libbsp/powerpc/qoriq/rtc/rtc-config.c +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file - * - * @ingroup QorIQ - * - * @brief RTC configuration. - */ - -/* - * Copyright (c) 2010 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#include <libchip/rtc.h> - -#define RTC_COUNT 1 - -static void qoriq_rtc_initialize(int minor) -{ - /* FIXME */ -} - -static int qoriq_rtc_get_time(int minor, rtems_time_of_day *tod) -{ - return -1; -} - -static int qoriq_rtc_set_time(int minor, const rtems_time_of_day *tod) -{ - return -1; -} - -static bool qoriq_rtc_probe(int minor) -{ - return false; -} - -const rtc_fns qoriq_rtc_ops = { - .deviceInitialize = qoriq_rtc_initialize, - .deviceGetTime = qoriq_rtc_get_time, - .deviceSetTime = qoriq_rtc_set_time -}; - -size_t RTC_Count = RTC_COUNT; - -rtc_tbl RTC_Table [RTC_COUNT] = { - { - .sDeviceName = "/dev/rtc", - .deviceType = RTC_CUSTOM, - .pDeviceFns = &qoriq_rtc_ops, - .deviceProbe = qoriq_rtc_probe, - .pDeviceParams = NULL, - .ulCtrlPort1 = 0, - .ulDataPort = 0, - .getRegister = NULL, - .setRegister = NULL - } -}; diff --git a/c/src/lib/libbsp/powerpc/shared/tod/todcfg.c b/c/src/lib/libbsp/powerpc/shared/tod/todcfg.c deleted file mode 100644 index 17ef18d5b5..0000000000 --- a/c/src/lib/libbsp/powerpc/shared/tod/todcfg.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file contains the RTC driver table for Motorola shared BSPs. - * - * 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. - */ - -#include <bsp.h> -#include <libchip/rtc.h> -#include <libchip/m48t08.h> - -/* Forward function declaration */ -#if !defined(mvme2100) -uint32_t mvmertc_get_register( uintptr_t, uint8_t ); -void mvmertc_set_register( uintptr_t, uint8_t, uint32_t ); -#endif - -/* The following table configures the RTC drivers used in this BSP */ -rtc_tbl RTC_Table[] = { - { - "/dev/rtc", /* sDeviceName */ - RTC_M48T08, /* deviceType -- actually M48T59 */ - &m48t08_fns, /* pDeviceFns */ - rtc_probe, /* deviceProbe */ - NULL, /* pDeviceParams */ -#if defined(mvme2100) - 0xFFE81ff8, /* ulCtrlPort1 */ - 0x00, /* ulDataPort */ - m48t08_get_register, /* getRegister */ - m48t08_set_register /* setRegister */ -#else - 0xFFE81ff8, /* ulCtrlPort1 */ - 0x00, /* ulDataPort */ - mvmertc_get_register, /* getRegister */ - mvmertc_set_register /* setRegister */ -#endif - } -}; - -/* Some information used by the RTC driver */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -size_t RTC_Count = NUM_RTCS; - -#if !defined(mvme2100) -#include <rtems/bspIo.h> -void mvmertc_set_register( - uintptr_t base, - uint8_t reg, - uint32_t value -) -{ - printk( "RTC SUPPORT NOT IMPLEMENTED ON THIS BOARD\n"); -} - -uint32_t mvmertc_get_register( - uintptr_t base, - uint8_t reg -) -{ - printk( "RTC SUPPORT NOT IMPLEMENTED ON THIS BOARD\n"); - return 0; -} -#endif |