forked from Imagelibrary/rtems
Merge branch 'master' of ssh://git.rtems.org/data/git/rtems
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -170,7 +172,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
}
|
||||
int_stat = *EP7312_INTSR3;
|
||||
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
.align
|
||||
PUBLIC_ARM_FUNCTION(_gba_ISR_handler)
|
||||
ldmfd r13!,{r0-r3,r12,r14}
|
||||
b arm_exc_interrupt
|
||||
b _ARMV4_Exception_interrupt
|
||||
LABEL_END(_gba_ISR_handler)
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ libbsp_a_SOURCES =
|
||||
# startup
|
||||
libbsp_a_SOURCES += ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../../shared/bsppredriverhook.c ../../shared/bspgetworkarea.c \
|
||||
../../shared/bsppretaskinghook.c startup/bspstart.c \
|
||||
../../shared/bsppretaskinghook.c startup/bspstart.c startup/bspidle.c \
|
||||
../../shared/bspclean.c startup/bspreset.c \
|
||||
startup/memmap.c ../../shared/bootcard.c ../../shared/sbrk.c \
|
||||
../../shared/gnatinstallhandler.c
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This include file contains definitions related to the GP32 BSP.
|
||||
* This include file contains definitions related to the GP32 BSP.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) Canon Research France SA.]
|
||||
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
||||
* Copyright (c) Canon Research France SA.]
|
||||
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
@@ -59,13 +59,13 @@ void gp32_setPalette( unsigned char pos, uint16_t color);
|
||||
|
||||
|
||||
/*
|
||||
* This BSP provides its own IDLE task to override the RTEMS one.
|
||||
* This BSP provides its own IDLE thread to override the RTEMS one.
|
||||
* So we prototype it and define the constant confdefs.h expects
|
||||
* to configure a BSP specific one.
|
||||
*/
|
||||
Thread bsp_idle_task(uint32_t);
|
||||
void *bsp_idle_thread(uintptr_t ignored);
|
||||
|
||||
#define BSP_IDLE_TASK_BODY bsp_idle_task
|
||||
#define BSP_IDLE_TASK_BODY bsp_idle_thread
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
23
c/src/lib/libbsp/arm/gp32/startup/bspidle.c
Normal file
23
c/src/lib/libbsp/arm/gp32/startup/bspidle.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* BSP specific Idle thread
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Canon Research Centre France SA.
|
||||
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
void *bsp_idle_thread(uintptr_t ignored)
|
||||
{
|
||||
while(1) {
|
||||
__asm__ volatile ("MCR p15,0,r0,c7,c0,4 \n");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
* This file contains the ARM BSP startup package. It includes application,
|
||||
* board, and monitor specific initialization and configuration. The generic CPU
|
||||
* dependent initialization has been performed before this routine is invoked.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Canon Research Centre France SA.
|
||||
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2000 Canon Research Centre France SA.
|
||||
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
@@ -22,16 +23,6 @@
|
||||
*/
|
||||
extern void rtems_exception_init_mngt(void);
|
||||
|
||||
/*
|
||||
* BSP specific Idle task
|
||||
*/
|
||||
Thread bsp_idle_task(uint32_t ignored)
|
||||
{
|
||||
while(1) {
|
||||
__asm__ volatile ("MCR p15,0,r0,c7,c0,4 \n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* BSP Specific Initialization in C
|
||||
*/
|
||||
|
||||
@@ -123,7 +123,7 @@ RTEMS_BSPOPTS_HELP([BSP_START_RESET_VECTOR],[reset vector address for BSP start]
|
||||
RTEMS_BSPOPTS_SET([BSP_USB_OTG_TRANSCEIVER_I2C_ADDR],[lpc17xx_ea*],[(0x2f << 1)])
|
||||
RTEMS_BSPOPTS_HELP([BSP_USB_OTG_TRANSCEIVER_I2C_ADDR],[USB OTG transceiver I2C address used by USB stack])
|
||||
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 1)
|
||||
RTEMS_BSP_LINKCMDS
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
@@ -27,6 +27,24 @@
|
||||
|
||||
#define LPC17XX_BASE 0x00
|
||||
|
||||
typedef struct {
|
||||
#define LPC17XX_WWDT_MOD_WDEN BSP_BIT32(0)
|
||||
#define LPC17XX_WWDT_MOD_WDRESET BSP_BIT32(1)
|
||||
#define LPC17XX_WWDT_MOD_WDTOF BSP_BIT32(2)
|
||||
#define LPC17XX_WWDT_MOD_WDINT BSP_BIT32(3)
|
||||
#define LPC17XX_WWDT_MOD_WDPROTECT BSP_BIT32(4)
|
||||
uint32_t mod;
|
||||
uint32_t tc;
|
||||
uint32_t feed;
|
||||
uint32_t tv;
|
||||
uint32_t reserved_10;
|
||||
uint32_t warnint;
|
||||
uint32_t window;
|
||||
uint32_t reserved_1c;
|
||||
} lpc17xx_wwdt;
|
||||
|
||||
#define LPC17XX_WWDT (*(volatile lpc17xx_wwdt *) (LPC17XX_BASE + 0x40000000))
|
||||
|
||||
typedef struct {
|
||||
#define LPC17XX_PLL_CON_PLLE BSP_BIT32(0)
|
||||
#define LPC17XX_PLL_SEL_MSEL(val) BSP_FLD32(val, 0, 4)
|
||||
@@ -176,7 +194,9 @@ typedef struct {
|
||||
#define LPC17XX_SCB (*(volatile lpc17xx_scb *) (LPC17XX_BASE + 0x400fc000))
|
||||
|
||||
typedef struct {
|
||||
uint32_t reserved_00 [268693504];
|
||||
uint32_t reserved_00 [268435456];
|
||||
lpc17xx_wwdt wwdt;
|
||||
uint32_t reserved_40000020 [258040];
|
||||
lpc17xx_scb scb;
|
||||
} lpc17xx;
|
||||
|
||||
|
||||
@@ -104,12 +104,16 @@ extern BSP_START_DATA_SECTION const lpc24xx_emc_static_chip_config
|
||||
extern BSP_START_DATA_SECTION const size_t
|
||||
lpc24xx_start_config_emc_static_chip_count;
|
||||
|
||||
#ifdef ARM_MULTILIB_ARCH_V7M
|
||||
|
||||
extern BSP_START_DATA_SECTION const ARMV7M_MPU_Region
|
||||
lpc24xx_start_config_mpu_region [];
|
||||
|
||||
extern BSP_START_DATA_SECTION const size_t
|
||||
lpc24xx_start_config_mpu_region_count;
|
||||
|
||||
#endif /* ARM_MULTILIB_ARCH_V7M */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -33,13 +35,13 @@ void bsp_interrupt_dispatch(void)
|
||||
rtems_vector_number vector = VICVectAddr;
|
||||
|
||||
/* Enable interrupts in program status register */
|
||||
uint32_t psr = arm_status_irq_enable();
|
||||
uint32_t psr = _ARMV4_Status_irq_enable();
|
||||
|
||||
/* Dispatch interrupt handlers */
|
||||
bsp_interrupt_handler_dispatch(vector);
|
||||
|
||||
/* Restore program status register */
|
||||
arm_status_restore(psr);
|
||||
_ARMV4_Status_restore(psr);
|
||||
|
||||
/* Acknowledge interrupt */
|
||||
VICVectAddr = 0;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
#include <rtems/score/armv7m.h>
|
||||
|
||||
#include <bsp.h>
|
||||
@@ -113,7 +114,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
}
|
||||
|
||||
/* Install the IRQ exception handler */
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved.
|
||||
* Copyright (c) 2008-2013 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/score/armv7m.h>
|
||||
|
||||
#include <bsp/bootcard.h>
|
||||
#include <bsp/lpc24xx.h>
|
||||
@@ -32,15 +33,16 @@ BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void)
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
#ifdef ARM_MULTILIB_ARCH_V4
|
||||
#if defined(ARM_MULTILIB_ARCH_V4)
|
||||
/* Trigger watchdog reset */
|
||||
WDCLKSEL = 0;
|
||||
WDTC = 0xff;
|
||||
WDMOD = 0x3;
|
||||
WDFEED = 0xaa;
|
||||
WDFEED = 0x55;
|
||||
#else
|
||||
printk("reset\n");
|
||||
#elif defined(ARM_MULTILIB_ARCH_V7M)
|
||||
_ARMV7M_SCB->aircr = ARMV7M_SCB_AIRCR_VECTKEY
|
||||
| ARMV7M_SCB_AIRCR_SYSRESETREQ;
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
|
||||
@@ -106,7 +106,7 @@ RTEMS_BSPOPTS_HELP([BSP_USB_OTG_TRANSCEIVER_I2C_ADDR],[USB OTG transceiver I2C a
|
||||
RTEMS_BSPOPTS_SET([TESTS_USE_PRINTK],[*],[1])
|
||||
RTEMS_BSPOPTS_HELP([TESTS_USE_PRINTK],[tests use printk() for output])
|
||||
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 1)
|
||||
RTEMS_BSP_LINKCMDS
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
@@ -45,7 +45,7 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val)
|
||||
#ifdef LPC32XX_UART_3_BAUD
|
||||
static bool lpc32xx_uart_probe_3(int minor)
|
||||
{
|
||||
LPC32XX_UARTCLK_CTRL |= 1U << 0;
|
||||
LPC32XX_UARTCLK_CTRL |= BSP_BIT32(0);
|
||||
LPC32XX_U3CLK = LPC32XX_CONFIG_U3CLK;
|
||||
LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 4, 5);
|
||||
|
||||
@@ -64,7 +64,7 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val)
|
||||
*/
|
||||
gpio->p2_mux_set = BSP_BIT32(2);
|
||||
|
||||
LPC32XX_UARTCLK_CTRL |= 1U << 1;
|
||||
LPC32XX_UARTCLK_CTRL |= BSP_BIT32(1);
|
||||
LPC32XX_U4CLK = LPC32XX_CONFIG_U4CLK;
|
||||
LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 6, 7);
|
||||
|
||||
@@ -75,7 +75,10 @@ static void lpc32xx_uart_set_register(uintptr_t addr, uint8_t i, uint8_t val)
|
||||
#ifdef LPC32XX_UART_6_BAUD
|
||||
static bool lpc32xx_uart_probe_6(int minor)
|
||||
{
|
||||
LPC32XX_UARTCLK_CTRL |= 1U << 3;
|
||||
/* Bypass the IrDA modulator/demodulator */
|
||||
LPC32XX_UART_CTRL |= BSP_BIT32(5);
|
||||
|
||||
LPC32XX_UARTCLK_CTRL |= BSP_BIT32(3);
|
||||
LPC32XX_U6CLK = LPC32XX_CONFIG_U6CLK;
|
||||
LPC32XX_UART_CLKMODE = BSP_FLD32SET(LPC32XX_UART_CLKMODE, 0x2, 10, 11);
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -252,11 +254,11 @@ void bsp_interrupt_dispatch(void)
|
||||
lpc32xx.sic_1.er = er_sic_1 & masks->field.sic_1;
|
||||
lpc32xx.sic_2.er = er_sic_2 & masks->field.sic_2;
|
||||
|
||||
psr = arm_status_irq_enable();
|
||||
psr = _ARMV4_Status_irq_enable();
|
||||
|
||||
bsp_interrupt_handler_dispatch(vector);
|
||||
|
||||
arm_status_restore(psr);
|
||||
_ARMV4_Status_restore(psr);
|
||||
|
||||
lpc32xx.mic.er = er_mic & lpc32xx_irq_enable.field.mic;
|
||||
lpc32xx.sic_1.er = er_sic_1 & lpc32xx_irq_enable.field.sic_1;
|
||||
@@ -341,7 +343,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
lpc32xx.sic_1.atr = 0x26000;
|
||||
lpc32xx.sic_2.atr = 0x0;
|
||||
|
||||
lpc32xx_set_exception_handler(ARM_EXCEPTION_IRQ, arm_exc_interrupt);
|
||||
lpc32xx_set_exception_handler(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -1323,6 +1323,9 @@ static int lpc_eth_up_or_down(lpc_eth_driver_entry *e, bool up)
|
||||
|
||||
lpc_eth_config_module_enable();
|
||||
|
||||
/* Enable RX/TX reset and disable soft reset */
|
||||
lpc_eth->mac1 = 0xf00;
|
||||
|
||||
/* Initialize PHY */
|
||||
lpc_eth->mcfg = ETH_MCFG_CLOCK_SELECT(0x7);
|
||||
eno = lpc_eth_phy_up(e);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
|
||||
* Copyright (c) 2008-2013 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Obere Lagerstr. 30
|
||||
@@ -31,6 +31,14 @@
|
||||
.extern boot_card
|
||||
.extern bsp_start_hook_0
|
||||
.extern bsp_start_hook_1
|
||||
.extern _ARMV4_Exception_undef_default
|
||||
.extern _ARMV4_Exception_swi_default
|
||||
.extern _ARMV4_Exception_data_abort_default
|
||||
.extern _ARMV4_Exception_pref_abort_default
|
||||
.extern _ARMV4_Exception_reserved_default
|
||||
.extern _ARMV4_Exception_irq_default
|
||||
.extern _ARMV4_Exception_fiq_default
|
||||
.extern _ARMV7M_Exception_default
|
||||
|
||||
/* Global symbols */
|
||||
.globl _start
|
||||
@@ -74,31 +82,31 @@ handler_addr_reset:
|
||||
|
||||
handler_addr_undef:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_undef_default
|
||||
|
||||
handler_addr_swi:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_swi_default
|
||||
|
||||
handler_addr_prefetch:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_data_abort_default
|
||||
|
||||
handler_addr_abort:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_pref_abort_default
|
||||
|
||||
handler_addr_reserved:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_reserved_default
|
||||
|
||||
handler_addr_irq:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_irq_default
|
||||
|
||||
handler_addr_fiq:
|
||||
|
||||
.word reset
|
||||
.word _ARMV4_Exception_fiq_default
|
||||
|
||||
bsp_start_vector_table_end:
|
||||
|
||||
@@ -199,13 +207,6 @@ twiddle:
|
||||
|
||||
b twiddle
|
||||
|
||||
.arm
|
||||
|
||||
reset:
|
||||
|
||||
SWITCH_FROM_ARM_TO_THUMB r0
|
||||
b twiddle
|
||||
|
||||
#elif defined(ARM_MULTILIB_ARCH_V7M)
|
||||
|
||||
.syntax unified
|
||||
@@ -218,22 +219,22 @@ bsp_start_vector_table_begin:
|
||||
|
||||
.word bsp_stack_main_end
|
||||
.word _start /* Reset */
|
||||
.word bsp_reset /* NMI */
|
||||
.word bsp_reset /* Hard Fault */
|
||||
.word bsp_reset /* MPU Fault */
|
||||
.word bsp_reset /* Bus Fault */
|
||||
.word bsp_reset /* Usage Fault */
|
||||
.word bsp_reset /* Reserved */
|
||||
.word bsp_reset /* Reserved */
|
||||
.word bsp_reset /* Reserved */
|
||||
.word bsp_reset /* Reserved */
|
||||
.word bsp_reset /* SVC */
|
||||
.word bsp_reset /* Debug Monitor */
|
||||
.word bsp_reset /* Reserved */
|
||||
.word bsp_reset /* PendSV */
|
||||
.word bsp_reset /* SysTick */
|
||||
.word _ARMV7M_Exception_default /* NMI */
|
||||
.word _ARMV7M_Exception_default /* Hard Fault */
|
||||
.word _ARMV7M_Exception_default /* MPU Fault */
|
||||
.word _ARMV7M_Exception_default /* Bus Fault */
|
||||
.word _ARMV7M_Exception_default /* Usage Fault */
|
||||
.word _ARMV7M_Exception_default /* Reserved */
|
||||
.word _ARMV7M_Exception_default /* Reserved */
|
||||
.word _ARMV7M_Exception_default /* Reserved */
|
||||
.word _ARMV7M_Exception_default /* Reserved */
|
||||
.word _ARMV7M_Exception_default /* SVC */
|
||||
.word _ARMV7M_Exception_default /* Debug Monitor */
|
||||
.word _ARMV7M_Exception_default /* Reserved */
|
||||
.word _ARMV7M_Exception_default /* PendSV */
|
||||
.word _ARMV7M_Exception_default /* SysTick */
|
||||
.rept BSP_INTERRUPT_VECTOR_MAX + 1
|
||||
.word bsp_reset /* IRQ */
|
||||
.word _ARMV7M_Exception_default /* IRQ */
|
||||
.endr
|
||||
|
||||
bsp_start_vector_table_end:
|
||||
|
||||
@@ -28,7 +28,7 @@ libbsp_a_SOURCES =
|
||||
|
||||
# startup
|
||||
libbsp_a_SOURCES += ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../gp32/startup/bspstart.c ../../shared/bspclean.c \
|
||||
../gp32/startup/bspstart.c ../gp32/startup/bspidle.c ../../shared/bspclean.c \
|
||||
startup/bspreset.c startup/memmap.c \
|
||||
../../shared/bootcard.c ../../shared/sbrk.c \
|
||||
../../shared/bsppretaskinghook.c \
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/* bsp.h
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Following defines must reflect the setup of the particular MVME167.
|
||||
* All page references are to the MVME166/MVME167/MVME187 Single Board
|
||||
* Computer Programmer's Reference Guide (MVME187PG/D2) with the April
|
||||
* 1993 supplements/addenda (MVME187PG/D2A1).
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -309,7 +312,7 @@ rtems_isr_entry set_vector(
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
extern rtems_isr_entry M68Kvec[]; /* vector table address */
|
||||
extern void *M68Kvec[]; /* vector table address */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/* bspclean.c
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* These routines return control to 167Bug after a normal exit from the
|
||||
* application.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2010.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -21,17 +24,11 @@
|
||||
extern void start( void );
|
||||
extern void page_table_teardown( void );
|
||||
|
||||
/*
|
||||
* bsp_return_to_monitor_trap
|
||||
/**
|
||||
* @brief bsp_return_to_monitor_trap
|
||||
*
|
||||
* Switch the VBR back to ROM and make a .RETURN syscall to return control to
|
||||
* 167 Bug. If 167Bug ever returns, restart the application.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values: NONE
|
||||
*/
|
||||
static void bsp_return_to_monitor_trap( void )
|
||||
{
|
||||
|
||||
@@ -1,30 +1,5 @@
|
||||
/* bspstart.c
|
||||
*
|
||||
* This set of routines starts the application. It includes application,
|
||||
* board, and monitor specific initialization and configuration. The generic
|
||||
* CPU dependent initialization has been performed before any of these are
|
||||
* invoked.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2010.
|
||||
* 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.com/license/LICENSE.
|
||||
*
|
||||
* Modifications of respective RTEMS files:
|
||||
* Copyright (c) 1998, National Research Council of Canada
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <page_table.h>
|
||||
#include <fatal.h>
|
||||
|
||||
void M68KFPSPInstallExceptionHandlers (void);
|
||||
extern rtems_isr_entry M68Kvec[];
|
||||
|
||||
/*
|
||||
* bsp_start()
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Board-specific initialization code. Called from the generic boot_card()
|
||||
* function defined in rtems/c/src/lib/libbsp/shared/main.c. That function
|
||||
@@ -43,22 +18,35 @@ extern rtems_isr_entry M68Kvec[];
|
||||
*
|
||||
* ASSUMES THAT 167BUG IS PRESENT TO CATCH ANY EXCEPTIONS DURING
|
||||
* INITIALIZATION.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values: NONE
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* 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.com/license/LICENSE.
|
||||
*
|
||||
* Modifications of respective RTEMS files:
|
||||
* Copyright (c) 1998, National Research Council of Canada
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/bootcard.h>
|
||||
#include <page_table.h>
|
||||
|
||||
void M68KFPSPInstallExceptionHandlers (void);
|
||||
|
||||
void bsp_start( void )
|
||||
{
|
||||
rtems_isr_entry *rom_monitor_vector_table;
|
||||
void **rom_monitor_vector_table;
|
||||
int index;
|
||||
|
||||
/*
|
||||
* 167Bug Vectors are at 0xFFE00000
|
||||
*/
|
||||
rom_monitor_vector_table = (rtems_isr_entry *)0xFFE00000;
|
||||
rom_monitor_vector_table = (void **)0xFFE00000;
|
||||
m68k_set_vbr( rom_monitor_vector_table );
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
/* Shm_isr_nobsp()
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* Template for Shared Memory Driver Interrupt Support
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -12,7 +17,7 @@
|
||||
#include <bsp.h>
|
||||
#include <shm_driver.h>
|
||||
|
||||
rtems_isr Shm_isr_nobsp( void )
|
||||
rtems_isr Shm_isr_nobsp(rtems_vector_number ignored)
|
||||
{
|
||||
/*
|
||||
* If this routine has to do anything other than the mpisr.c
|
||||
@@ -22,20 +27,15 @@ rtems_isr Shm_isr_nobsp( void )
|
||||
* must be cleared.
|
||||
*
|
||||
* If the generic mpisr.c satisifies your requirements, then
|
||||
* remove this routine from your target's shmsupp/mpisb.c file.
|
||||
* remove this routine from your target's shmsupp/mpisr.c file.
|
||||
* Then simply install the generic Shm_isr in the Shm_setvec
|
||||
* routine below.
|
||||
*/
|
||||
}
|
||||
|
||||
/* Shm_setvec
|
||||
*
|
||||
/*
|
||||
* This driver routine sets the SHM interrupt vector to point to the
|
||||
* driver's SHM interrupt service routine.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
void Shm_setvec( void )
|
||||
|
||||
@@ -66,6 +66,7 @@ libbsp_a_SOURCES += ../../shared/bsplibc.c \
|
||||
startup/bspstart.c \
|
||||
../../shared/bspclean.c \
|
||||
startup/bspreset.c \
|
||||
startup/bsprestart.c \
|
||||
../../shared/bspgetworkarea.c \
|
||||
../../shared/src/bsp-uboot-board-info.c \
|
||||
../shared/uboot_getenv.c
|
||||
|
||||
@@ -76,7 +76,7 @@ AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
RTEMS_BSP_BOOTCARD_OPTIONS
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
|
||||
RTEMS_BSP_CLEANUP_OPTIONS(0, 1)
|
||||
RTEMS_BSP_LINKCMDS
|
||||
|
||||
RTEMS_PPC_EXCEPTIONS
|
||||
|
||||
@@ -20,10 +20,31 @@
|
||||
|
||||
#include <mpc83xx/mpc83xx_i2cdrv.h>
|
||||
#include <libchip/i2c-2b-eeprom.h>
|
||||
#include <libchip/i2c-sc620.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp.h>
|
||||
|
||||
static mpc83xx_i2c_desc_t mpc83xx_i2c_bus_tbl[2] = {
|
||||
static void i2c1_probe(mpc83xx_i2c_softc_t *self)
|
||||
{
|
||||
#if MPC83XX_CHIP_TYPE != 8309
|
||||
if (((mpc83xx.clk.sccr >> (31-1)) & 0x03) > 0) {
|
||||
self->base_frq =
|
||||
(BSP_bus_frequency
|
||||
/((mpc83xx.clk.sccr >> (31-1)) & 0x03));
|
||||
}
|
||||
#else /* MPC83XX_CHIP_TYPE != 8309 */
|
||||
self->base_frq = BSP_bus_frequency;
|
||||
#endif /* MPC83XX_CHIP_TYPE != 8309 */
|
||||
}
|
||||
|
||||
#ifndef MPC83XX_BOARD_BR_UID
|
||||
static void i2c2_probe(mpc83xx_i2c_softc_t *self)
|
||||
{
|
||||
self->base_frq = BSP_bus_frequency;
|
||||
}
|
||||
#endif /* MPC83XX_BOARD_BR_UID */
|
||||
|
||||
static mpc83xx_i2c_desc_t mpc83xx_i2c_bus_tbl[] = {
|
||||
/* first channel */
|
||||
{
|
||||
{/* public fields */
|
||||
@@ -34,27 +55,26 @@ static mpc83xx_i2c_desc_t mpc83xx_i2c_bus_tbl[2] = {
|
||||
.reg_ptr = &mpc83xx.i2c[0],
|
||||
.initialized = FALSE,
|
||||
.irq_number = BSP_IPIC_IRQ_I2C1,
|
||||
.base_frq = 0 /* will be set during initiailization */
|
||||
.base_frq = 0, /* will be set during probe */
|
||||
.probe = i2c1_probe
|
||||
}
|
||||
},
|
||||
}
|
||||
#ifndef MPC83XX_BOARD_BR_UID
|
||||
/* second channel */
|
||||
{
|
||||
, {
|
||||
{ /* public fields */
|
||||
.ops = &mpc83xx_i2c_ops,
|
||||
.size = sizeof(mpc83xx_i2c_bus_tbl[1]),
|
||||
.size = sizeof(mpc83xx_i2c_bus_tbl[0]),
|
||||
},
|
||||
{ /* our private fields */
|
||||
.reg_ptr = &mpc83xx.i2c[1],
|
||||
.initialized = FALSE,
|
||||
.irq_number = BSP_IPIC_IRQ_I2C2,
|
||||
.base_frq = 0 /* will be set during initiailization */
|
||||
.base_frq = 0, /* will be set during probe */
|
||||
.probe = i2c2_probe
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
rtems_libi2c_bus_t *mpc83xx_i2c_bus_descriptor[2] = {
|
||||
&mpc83xx_i2c_bus_tbl[0].bus_desc,
|
||||
&mpc83xx_i2c_bus_tbl[1].bus_desc
|
||||
#endif /* MPC83XX_BOARD_BR_UID */
|
||||
};
|
||||
|
||||
/*=========================================================================*\
|
||||
@@ -76,8 +96,10 @@ rtems_status_code bsp_register_i2c
|
||||
\*=========================================================================*/
|
||||
|
||||
{
|
||||
int ret_code;
|
||||
int i2c1_busno,i2c2_busno;
|
||||
char device_path[] = "/dev/i2c?";
|
||||
size_t n = RTEMS_ARRAY_SIZE(mpc83xx_i2c_bus_tbl);
|
||||
size_t i;
|
||||
int i2c_busno[n];
|
||||
|
||||
/*
|
||||
* init I2C library (if not already done)
|
||||
@@ -85,54 +107,41 @@ rtems_status_code bsp_register_i2c
|
||||
rtems_libi2c_initialize ();
|
||||
|
||||
/*
|
||||
* update input frequency of I2c modules into descriptor
|
||||
* init I2C buses
|
||||
*/
|
||||
/*
|
||||
* I2C1 is clocked with TSEC 1
|
||||
*/
|
||||
if (((mpc83xx.clk.sccr >> (31-1)) & 0x03) > 0) {
|
||||
mpc83xx_i2c_bus_tbl[0].softc.base_frq =
|
||||
(BSP_bus_frequency
|
||||
/((mpc83xx.clk.sccr >> (31-1)) & 0x03));
|
||||
}
|
||||
for (i = 0; i < n; ++i) {
|
||||
mpc83xx_i2c_desc_t *desc = &mpc83xx_i2c_bus_tbl[i];
|
||||
|
||||
mpc83xx_i2c_bus_tbl[1].softc.base_frq = BSP_bus_frequency;
|
||||
/*
|
||||
* register first I2C bus
|
||||
*/
|
||||
ret_code = rtems_libi2c_register_bus("/dev/i2c1",
|
||||
mpc83xx_i2c_bus_descriptor[0]);
|
||||
if (ret_code < 0) {
|
||||
return -ret_code;
|
||||
(*desc->softc.probe)(&desc->softc);
|
||||
device_path[sizeof(device_path) - 2] = (char) ('1' + i);
|
||||
i2c_busno[i] = rtems_libi2c_register_bus(device_path, &desc->bus_desc);
|
||||
}
|
||||
i2c1_busno = ret_code;
|
||||
/*
|
||||
* register second I2C bus
|
||||
*/
|
||||
ret_code = rtems_libi2c_register_bus("/dev/i2c2",
|
||||
mpc83xx_i2c_bus_descriptor[1]);
|
||||
if (ret_code < 0) {
|
||||
return -ret_code;
|
||||
}
|
||||
i2c2_busno = ret_code;
|
||||
|
||||
#ifdef RTEMS_BSP_I2C_EEPROM_DEVICE_NAME
|
||||
|
||||
/*
|
||||
* register EEPROM to bus 1, Address 0x50
|
||||
*/
|
||||
ret_code = rtems_libi2c_register_drv(RTEMS_BSP_I2C_EEPROM_DEVICE_NAME,
|
||||
i2c_2b_eeprom_driver_descriptor,
|
||||
i2c1_busno,0x50);
|
||||
|
||||
if (ret_code < 0) {
|
||||
return -ret_code;
|
||||
if (n > 0) {
|
||||
/*
|
||||
* register EEPROM to bus 1, Address 0x50
|
||||
*/
|
||||
rtems_libi2c_register_drv(RTEMS_BSP_I2C_EEPROM_DEVICE_NAME,
|
||||
i2c_2b_eeprom_driver_descriptor,
|
||||
i2c_busno[0],0x50);
|
||||
}
|
||||
|
||||
#endif /* RTEMS_BSP_I2C_EEPROM_DEVICE_NAME */
|
||||
|
||||
#ifdef MPC83XX_BOARD_BR_UID
|
||||
if (n > 0) {
|
||||
rtems_libi2c_register_drv(
|
||||
"sc620",
|
||||
&i2c_sc620_driver,
|
||||
i2c_busno[0],
|
||||
0x70
|
||||
);
|
||||
}
|
||||
#endif /* MPC83XX_BOARD_BR_UID */
|
||||
|
||||
/*
|
||||
* FIXME: register RTC driver, when available
|
||||
*/
|
||||
return 0;
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -145,6 +145,8 @@ void mpc83xx_zero_4( void *dest, size_t n);
|
||||
|
||||
void cpu_init( void);
|
||||
|
||||
void bsp_restart(void *addr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
46
c/src/lib/libbsp/powerpc/gen83xx/startup/bsprestart.c
Normal file
46
c/src/lib/libbsp/powerpc/gen83xx/startup/bsprestart.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2008-2013 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.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/u-boot.h>
|
||||
|
||||
#include <libcpu/powerpc-utility.h>
|
||||
|
||||
void bsp_restart(void *addr)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
void (*start)(void) = addr;
|
||||
#ifdef HAS_UBOOT
|
||||
const void *mem_begin = (const void *) bsp_uboot_board_info.bi_memstart;
|
||||
size_t mem_size = bsp_uboot_board_info.bi_memsize;
|
||||
#else /* HAS_UBOOT */
|
||||
const void *mem_begin = bsp_ram_start;
|
||||
size_t mem_size = (size_t) bsp_ram_size;
|
||||
#endif /* HAS_UBOOT */
|
||||
uint32_t hid0;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
hid0 = PPC_SPECIAL_PURPOSE_REGISTER(HID0);
|
||||
|
||||
if ((hid0 & HID0_DCE) != 0) {
|
||||
rtems_cache_flush_multiple_data_lines(mem_begin, mem_size);
|
||||
}
|
||||
|
||||
hid0 &= ~(HID0_DCE | HID0_ICE);
|
||||
|
||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
|
||||
|
||||
(*start)();
|
||||
}
|
||||
@@ -141,14 +141,21 @@ void cpu_init( void)
|
||||
{
|
||||
BAT dbat, ibat;
|
||||
uint32_t msr;
|
||||
uint32_t hid0;
|
||||
|
||||
/* Clear MMU and segment registers */
|
||||
clear_mmu_regs();
|
||||
|
||||
/* Clear caches */
|
||||
PPC_CLEAR_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ILOCK | HID0_DLOCK | HID0_ICE | HID0_DCE);
|
||||
PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ICFI | HID0_DCI);
|
||||
PPC_CLEAR_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ICFI | HID0_DCI);
|
||||
hid0 = PPC_SPECIAL_PURPOSE_REGISTER(HID0);
|
||||
if ((hid0 & (HID0_ICE | HID0_DCE)) == 0) {
|
||||
hid0 &= ~(HID0_ILOCK | HID0_DLOCK | HID0_ICE | HID0_DCE);
|
||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
|
||||
hid0 |= HID0_ICFI | HID0_DCI;
|
||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
|
||||
hid0 &= ~(HID0_ICFI | HID0_DCI);
|
||||
PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up IBAT registers in MMU
|
||||
|
||||
@@ -8,7 +8,6 @@ MEMORY {
|
||||
RAM : ORIGIN = 0x0, LENGTH = 256M
|
||||
ROM : ORIGIN = 0xfe000000, LENGTH = 2M
|
||||
MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 256k
|
||||
NIRVANA : ORIGIN = 0x0, LENGTH = 0
|
||||
}
|
||||
|
||||
INCLUDE linkcmds.base
|
||||
|
||||
@@ -32,6 +32,11 @@ RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([gwlcfm],[])
|
||||
RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1])
|
||||
RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED
|
||||
|
||||
RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_USE_WRITE_THROUGH],[mpc5674f_ecu508*],[1])
|
||||
RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_USE_WRITE_THROUGH],[*],[])
|
||||
RTEMS_BSPOPTS_HELP([BSP_DATA_CACHE_USE_WRITE_THROUGH],
|
||||
[use write-through for data cache])
|
||||
|
||||
RTEMS_BSPOPTS_SET([PPC_EXC_CONFIG_USE_FIXED_HANDLER],[*],[1])
|
||||
RTEMS_BSPOPTS_HELP([PPC_EXC_CONFIG_USE_FIXED_HANDLER],
|
||||
[use fixed high-level exception handler])
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
#include <bsp/mpc83xx_i2cdrv.h>
|
||||
|
||||
#if MPC55XX_CHIP_FAMILY == 551
|
||||
static void i2c_probe(mpc83xx_i2c_softc_t *self)
|
||||
{
|
||||
self->base_frq = bsp_clock_speed;
|
||||
}
|
||||
|
||||
static mpc83xx_i2c_desc_t mpc55xx_i2c_bus = {
|
||||
.bus_desc = {
|
||||
.ops = &mpc83xx_i2c_ops,
|
||||
@@ -33,7 +38,8 @@
|
||||
.reg_ptr = (m83xxI2CRegisters_t *) 0xfff88000,
|
||||
.initialized = FALSE,
|
||||
.irq_number = MPC55XX_IRQ_I2C(0),
|
||||
.base_frq = 0
|
||||
.base_frq = 0,
|
||||
.probe = i2c_probe
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,7 +50,6 @@
|
||||
|
||||
rtems_libi2c_initialize ();
|
||||
|
||||
mpc55xx_i2c_bus.softc.base_frq = bsp_clock_speed;
|
||||
busno = rtems_libi2c_register_bus(
|
||||
"/dev/i2c1",
|
||||
&mpc55xx_i2c_bus.bus_desc
|
||||
|
||||
@@ -85,7 +85,11 @@ const struct MMU_tag mpc55xx_start_config_mmu [] = {
|
||||
MPC55XX_MMU_TAG_INITIALIZER(9, 0x00100000, MPC55XX_MMU_1M, 1, 0, 1, 0),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(10, 0x00200000, MPC55XX_MMU_2M, 1, 0, 1, 0),
|
||||
/* External SRAM 2M */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(2, 0x20000000, MPC55XX_MMU_2M, 0, 1, 1, 0),
|
||||
#ifndef BSP_DATA_CACHE_USE_WRITE_THROUGH
|
||||
MPC55XX_MMU_TAG_INITIALIZER(2, 0x20000000, MPC55XX_MMU_2M, 0, 1, 1, 0),
|
||||
#else
|
||||
MPC55XX_MMU_TAG_INITIALIZER(2, 0x20000000, MPC55XX_MMU_2M, 0, 1, 1, 2),
|
||||
#endif
|
||||
/* Internal SRAM 256k */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(3, 0x40000000, MPC55XX_MMU_256K, 0, 1, 1, 0),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(11, 0x40020000, MPC55XX_MMU_64K, 0, 1, 1, 0),
|
||||
@@ -118,6 +122,8 @@ const struct MMU_tag mpc55xx_start_config_mmu [] = {
|
||||
MPC55XX_MMU_TAG_INITIALIZER(8, 0x00080000, MPC55XX_MMU_512K, 1, 0, 1, 0),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(9, 0x00100000, MPC55XX_MMU_1M, 1, 0, 1, 0),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(10, 0x00200000, MPC55XX_MMU_2M, 1, 0, 1, 0),
|
||||
/* External MRAM 4M */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(2, 0x20000000, MPC55XX_MMU_4M, 0, 1, 1, 0),
|
||||
/* Internal SRAM 256k */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(3, 0x40000000, MPC55XX_MMU_256K, 0, 1, 1, 0),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(11, 0x40020000, MPC55XX_MMU_64K, 0, 1, 1, 0),
|
||||
@@ -125,13 +131,11 @@ const struct MMU_tag mpc55xx_start_config_mmu [] = {
|
||||
MPC55XX_MMU_TAG_INITIALIZER(13, 0x40038000, MPC55XX_MMU_16K, 0, 1, 1, 0),
|
||||
/* Used as cache-inhibited area (ADC, DSPI queues) */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(14, 0x4003c000, MPC55XX_MMU_16K, 0, 1, 1, 1),
|
||||
/* External MRAM 4M */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(15, 0x20000000, MPC55XX_MMU_4M, 0, 1, 1, 0),
|
||||
/* External FPGA */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(16, 0x21000000, MPC55XX_MMU_8M, 0, 1, 1, 1),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(15, 0x21000000, MPC55XX_MMU_8M, 0, 1, 1, 1),
|
||||
#if defined(MPC55XX_BOARD_MPC5674F_RSM6_KOMA)
|
||||
/* External Ethernet controller */
|
||||
MPC55XX_MMU_TAG_INITIALIZER(18, 0x23000000, MPC55XX_MMU_1K, 0, 1, 1, 1),
|
||||
MPC55XX_MMU_TAG_INITIALIZER(17, 0x23000000, MPC55XX_MMU_1K, 0, 1, 1, 1),
|
||||
#endif
|
||||
#else
|
||||
/* Used as cache-inhibited area (ADC, DSPI queues) */
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
#include <bspopts.h>
|
||||
#include <rtems/powerpc/powerpc.h>
|
||||
|
||||
#if BSP_DATA_CACHE_ENABLED && PPC_CACHE_ALIGNMENT == 32
|
||||
#if BSP_DATA_CACHE_ENABLED \
|
||||
&& PPC_CACHE_ALIGNMENT == 32 \
|
||||
&& !defined(BSP_DATA_CACHE_USE_WRITE_THROUGH)
|
||||
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -67,6 +67,8 @@ extern "C" {
|
||||
} rtems_irq_symbolic_name;
|
||||
|
||||
extern rtems_irq_connect_data *BSP_rtems_irq_tbl;
|
||||
void BSP_irqexc_on_fnc(const rtems_irq_connect_data *conn_data);
|
||||
void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused);
|
||||
void BSP_rtems_irq_mngt_init(unsigned cpuId);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -91,7 +91,7 @@ void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused)
|
||||
/***********************************************************
|
||||
* High level IRQ handler called from shared_raw_irq_code_entry
|
||||
*/
|
||||
int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
static int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
{
|
||||
/*
|
||||
* Handle interrupt
|
||||
|
||||
@@ -139,7 +139,7 @@ void BSP_ask_for_reset(void)
|
||||
|
||||
void BSP_panic(char *s)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
__attribute__((unused)) rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
@@ -151,7 +151,7 @@ void BSP_panic(char *s)
|
||||
|
||||
void _BSP_Fatal_error(unsigned int v)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
__attribute__((unused)) rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
|
||||
@@ -67,14 +67,15 @@ extern "C" {
|
||||
} rtems_irq_symbolic_name;
|
||||
|
||||
extern rtems_irq_connect_data *BSP_rtems_irq_tbl;
|
||||
void BSP_irqexc_on_fnc(const rtems_irq_connect_data *conn_data);
|
||||
void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused);
|
||||
void BSP_rtems_irq_mngt_init(unsigned cpuId);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#define BSP_DEC BSP_PIT
|
||||
#define BSP_DECREMENTER BSP_PIT
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ASM */
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused)
|
||||
|
||||
SPR_RW(BOOKE_TSR)
|
||||
|
||||
int C_dispatch_dec_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
static int C_dispatch_dec_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
{
|
||||
/* Acknowledge the interrupt */
|
||||
_write_BOOKE_TSR( BOOKE_TSR_DIS );
|
||||
@@ -105,7 +105,7 @@ int C_dispatch_dec_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
/***********************************************************
|
||||
* High level IRQ handler called from shared_raw_irq_code_entry
|
||||
*/
|
||||
int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
static int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
|
||||
{
|
||||
/*
|
||||
* Handle interrupt
|
||||
|
||||
@@ -152,7 +152,7 @@ void BSP_ask_for_reset(void)
|
||||
|
||||
void BSP_panic(char *s)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
__attribute__((unused)) rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
@@ -164,7 +164,7 @@ void BSP_panic(char *s)
|
||||
|
||||
void _BSP_Fatal_error(unsigned int v)
|
||||
{
|
||||
rtems_interrupt_level level;
|
||||
__attribute__((unused)) rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
|
||||
@@ -220,8 +220,8 @@ rtems_status_code rtems_interrupt_server_handler_remove(
|
||||
|
||||
sc = rtems_interrupt_handler_remove(
|
||||
vector,
|
||||
ie.entry->handler,
|
||||
ie.entry->arg
|
||||
bsp_interrupt_server_trigger,
|
||||
ie.entry
|
||||
);
|
||||
if (sc != RTEMS_SUCCESSFUL) {
|
||||
return sc;
|
||||
|
||||
@@ -54,7 +54,7 @@ int rtems_leon_open_eth_driver_attach(
|
||||
*(volatile int *) base_addr = 0;
|
||||
*(volatile int *) base_addr = 0x800;
|
||||
*(volatile int *) base_addr = 0;
|
||||
leon_open_eth_configuration.base_address = base_addr;
|
||||
leon_open_eth_configuration.base_address = (void *) base_addr;
|
||||
leon_open_eth_configuration.vector = eth_irq + 0x10;
|
||||
leon_open_eth_configuration.txd_count = TDA_COUNT;
|
||||
leon_open_eth_configuration.rxd_count = RDA_COUNT;
|
||||
|
||||
@@ -1,27 +1,11 @@
|
||||
/* void Shm_Get_configuration( localnode, &shmcfg )
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This routine initializes, if necessary, and returns a pointer
|
||||
* to the Shared Memory Configuration Table for the XXX target.
|
||||
*
|
||||
* INPUT PARAMETERS:
|
||||
* localnode - local node number
|
||||
* shmcfg - address of pointer to SHM Config Table
|
||||
*
|
||||
* OUTPUT PARAMETERS:
|
||||
* *shmcfg - pointer to SHM Config Table
|
||||
*
|
||||
XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
|
||||
* NOTES: The XYZ does not have an interprocessor interrupt.
|
||||
*
|
||||
* The following table illustrates the configuration limitations:
|
||||
*
|
||||
* BUS MAX
|
||||
* MODE ENDIAN NODES
|
||||
* ========= ====== =======
|
||||
* POLLED BIG 2+
|
||||
* INTERRUPT **** NOT SUPPORTED ****
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* LEON3 Shared Memory Driver Support - Configuration
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -35,7 +19,6 @@ XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN
|
||||
|
||||
/* multiprocessor communications interface (MPCI) table */
|
||||
|
||||
|
||||
extern rtems_mpci_entry Shm_Get_packet(
|
||||
rtems_packet_prefix **
|
||||
);
|
||||
@@ -56,19 +39,11 @@ extern rtems_mpci_entry Shm_Send_packet(
|
||||
);
|
||||
|
||||
|
||||
/* rtems_mpci_table MPCI_table = { */
|
||||
/* 100000, /\* default timeout value in ticks *\/ */
|
||||
/* MAX_PACKET_SIZE, /\* maximum packet size *\/ */
|
||||
/* Shm_Initialization, /\* initialization procedure *\/ */
|
||||
/* Shm_Get_packet, /\* get packet procedure *\/ */
|
||||
/* Shm_Return_packet, /\* return packet procedure *\/ */
|
||||
/* Shm_Send_packet, /\* packet send procedure *\/ */
|
||||
/* Shm_Receive_packet /\* packet receive procedure *\/ */
|
||||
/* }; */
|
||||
|
||||
|
||||
/*
|
||||
* configured if currently polling of interrupt driven
|
||||
* configured if currently polling or interrupt driven
|
||||
*
|
||||
* NOTE: Code in mpisr.c is commented out. Fix when interrupt mode
|
||||
* is added.
|
||||
*/
|
||||
|
||||
#define INTERRUPT 0 /* XXX: */
|
||||
@@ -95,7 +70,6 @@ void Shm_Get_configuration(
|
||||
shm_config_table **shmcfg
|
||||
)
|
||||
{
|
||||
extern rtems_configuration_table Configuration;
|
||||
int i;
|
||||
unsigned int tmp;
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
/* Shared Memory Lock Routines
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* LEON3 Shared Memory Lock Routines
|
||||
*
|
||||
* This shared memory locked queue support routine need to be
|
||||
* able to lock the specified locked queue. Interrupts are
|
||||
* disabled while the queue is locked to prevent preemption
|
||||
* and deadlock when two tasks poll for the same lock.
|
||||
* previous level.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -20,11 +25,8 @@
|
||||
|
||||
|
||||
/*
|
||||
* Shm_Initialize_lock
|
||||
*
|
||||
* Initialize the lock for the specified locked queue.
|
||||
*/
|
||||
|
||||
void Shm_Initialize_lock(
|
||||
Shm_Locked_queue_Control *lq_cb
|
||||
)
|
||||
@@ -32,12 +34,12 @@ void Shm_Initialize_lock(
|
||||
lq_cb->lock = LQ_UNLOCKED;
|
||||
}
|
||||
|
||||
/* void _Shm_Lock( &lq_cb )
|
||||
*
|
||||
/*
|
||||
* This shared memory locked queue support routine locks the
|
||||
* specified locked queue. It disables interrupts to prevent
|
||||
* a deadlock condition.
|
||||
*/
|
||||
extern unsigned int LEON3_Atomic_Swap(uint32_t value, uint32_t *address);
|
||||
|
||||
__asm__ (
|
||||
".text\n"
|
||||
@@ -63,16 +65,9 @@ void Shm_Lock(
|
||||
Shm_isrstat = isr_level;
|
||||
while ( lock_value ) {
|
||||
lock_value = LEON3_Atomic_Swap(lock_value, lockptr);
|
||||
/* __asm__ volatile( "" */
|
||||
/* : "=r" (lockptr), "=r" (lock_value) */
|
||||
/* : "0" (lockptr), "1" (lock_value) */
|
||||
/* ); */
|
||||
/*
|
||||
* If not available, then may want to delay to reduce load on lock.
|
||||
*/
|
||||
|
||||
/* if ( lock_value ) */
|
||||
/* rtems_bsp_delay( 10 ); /\* approximately 10 microseconds *\/ */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
/* Shm_isr_nobsp()
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* LEON3 Shared Memory Driver Interrupt Support
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2012.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -12,7 +17,8 @@
|
||||
#include <bsp.h>
|
||||
#include <shm_driver.h>
|
||||
|
||||
rtems_isr Shm_isr_nobsp( void )
|
||||
#if 0
|
||||
void Shm_isr(void)
|
||||
{
|
||||
/*
|
||||
* If this routine has to do anything other than the mpisr.c
|
||||
@@ -22,25 +28,23 @@ rtems_isr Shm_isr_nobsp( void )
|
||||
* must be cleared.
|
||||
*
|
||||
* If the generic mpisr.c satisifies your requirements, then
|
||||
* remove this routine from your target's shmsupp/mpisb.c file.
|
||||
* remove this routine from your target's shmsupp/mpisr.c file.
|
||||
* Then simply install the generic Shm_isr in the Shm_setvec
|
||||
* routine below.
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Shm_setvec
|
||||
*
|
||||
/*
|
||||
* This driver routine sets the SHM interrupt vector to point to the
|
||||
* driver's SHM interrupt service routine.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
|
||||
void Shm_setvec( void )
|
||||
{
|
||||
/*
|
||||
* Interrupt driven mode is not currently supported.
|
||||
* This is thought to be the interrupt to use.
|
||||
*/
|
||||
LEON_Unmask_interrupt(LEON3_MP_IRQ);
|
||||
set_vector(Shm_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
|
||||
set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -50,7 +52,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
/* disable all interrupts */
|
||||
AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
|
||||
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -64,7 +66,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
VICVectAddr = 0;
|
||||
|
||||
/* Install the IRQ exception handler */
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -36,7 +38,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
|
||||
rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
{
|
||||
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -45,7 +47,7 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
XSCALE_INT_ICLR = 0x0;
|
||||
|
||||
/* Install the IRQ exception handler */
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/armv4.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
#include <bsp/irq-generic.h>
|
||||
@@ -37,7 +39,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
|
||||
|
||||
rtems_status_code bsp_interrupt_facility_initialize(void)
|
||||
{
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,8 @@ extern "C" {
|
||||
.VALID = 1, .IPROT = 1, .TID = 0, .TS = 0, .TSIZE = (size) } \
|
||||
}, \
|
||||
.MAS2 = { .B = { \
|
||||
.EPN = (addr) >> 10, .VLE = 0, .W = 0, .I = (io), .M = 0, .G = (io), .E = 0 } \
|
||||
.EPN = (addr) >> 10, .VLE = 0, \
|
||||
.W = (io) == 2, .I = (io) == 1, .M = 0, .G = (io) == 1, .E = 0 } \
|
||||
}, \
|
||||
.MAS3 = { .B = { \
|
||||
.RPN = (addr) >> 10, .U0 = 0, .U1 = 0, .U2 = 0, .U3 = 0, .UX = 0, \
|
||||
|
||||
@@ -493,7 +493,6 @@ static rtems_status_code mpc83xx_i2c_send_addr
|
||||
\*=========================================================================*/
|
||||
{
|
||||
mpc83xx_i2c_softc_t *softc_ptr = &(((mpc83xx_i2c_desc_t *)(bh))->softc);
|
||||
bool long_addr = false;
|
||||
uint8_t addr_byte;
|
||||
rtems_status_code rc;
|
||||
|
||||
@@ -505,7 +504,6 @@ static rtems_status_code mpc83xx_i2c_send_addr
|
||||
* determine, whether short or long address is needed, determine rd/wr
|
||||
*/
|
||||
if (addr > 0x7f) {
|
||||
long_addr = true;
|
||||
addr_byte = (0xf0
|
||||
| ((addr >> 7) & 0x06)
|
||||
| ((rw) ? 1 : 0));
|
||||
@@ -565,7 +563,6 @@ static int mpc83xx_i2c_read_bytes
|
||||
mpc83xx_i2c_softc_t *softc_ptr = &(((mpc83xx_i2c_desc_t *)(bh))->softc);
|
||||
rtems_status_code rc;
|
||||
unsigned char *p = buf;
|
||||
unsigned char dummy;
|
||||
|
||||
#if defined(DEBUG)
|
||||
printk("mpc83xx_i2c_read_bytes called... ");
|
||||
@@ -579,7 +576,7 @@ static int mpc83xx_i2c_read_bytes
|
||||
/*
|
||||
* we need a dummy transfer here to start the first read
|
||||
*/
|
||||
dummy = softc_ptr->reg_ptr->i2cdr;
|
||||
softc_ptr->reg_ptr->i2cdr;
|
||||
|
||||
while (len-- > 0) {
|
||||
if (len == 0) {
|
||||
|
||||
@@ -49,6 +49,7 @@ typedef struct mpc83xx_i2c_softc {
|
||||
rtems_irq_number irq_number; /* IRQ number used for this module */
|
||||
uint32_t base_frq; /* input frq for baud rate divider */
|
||||
rtems_id irq_sema_id; /* SEMA used for IRQ signalling */
|
||||
void (*probe)(struct mpc83xx_i2c_softc *self);
|
||||
} mpc83xx_i2c_softc_t ;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -67,6 +67,7 @@ EXTRA_DIST += rtc/README.ds1643 rtc/README.icm7170 rtc/README.m48t08 \
|
||||
# i2c
|
||||
include_libchip_HEADERS += i2c/i2c-ds1621.h \
|
||||
i2c/i2c-2b-eeprom.h \
|
||||
i2c/i2c-sc620.h \
|
||||
i2c/spi-memdrv.h \
|
||||
i2c/spi-flash-m25p40.h \
|
||||
i2c/spi-fram-fm25l256.h \
|
||||
@@ -82,6 +83,7 @@ libi2cio_a_SOURCES = i2c/i2c-ds1621.h \
|
||||
i2c/spi-fram-fm25l256.h \
|
||||
i2c/i2c-ds1621.c \
|
||||
i2c/i2c-2b-eeprom.c \
|
||||
i2c/i2c-sc620.c \
|
||||
i2c/spi-memdrv.c \
|
||||
i2c/spi-flash-m25p40.c \
|
||||
i2c/spi-fram-fm25l256.c \
|
||||
|
||||
95
c/src/libchip/i2c/i2c-sc620.c
Normal file
95
c/src/libchip/i2c/i2c-sc620.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief I2C Driver for SEMTECH SC620 Octal LED Driver
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 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.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <libchip/i2c-sc620.h>
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
#define SC620_REG_COUNT 10
|
||||
|
||||
static rtems_status_code i2c_sc620_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
rtems_status_code sc = RTEMS_IO_ERROR;
|
||||
rtems_libio_rw_args_t *rw = arg;
|
||||
unsigned char *buf = (unsigned char *) &rw->buffer[0];
|
||||
|
||||
if (rw->count == 2 && buf[0] < SC620_REG_COUNT) {
|
||||
int rv;
|
||||
|
||||
rv = rtems_libi2c_start_write_bytes(
|
||||
minor, buf, 2
|
||||
);
|
||||
if (rv == 2) {
|
||||
sc = rtems_libi2c_send_stop(minor);
|
||||
}
|
||||
}
|
||||
|
||||
rw->bytes_moved = sc == RTEMS_SUCCESSFUL ? 2 : 0;
|
||||
|
||||
return sc;
|
||||
}
|
||||
|
||||
static rtems_status_code i2c_sc620_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg
|
||||
)
|
||||
{
|
||||
rtems_status_code sc = RTEMS_IO_ERROR;
|
||||
rtems_libio_rw_args_t *rw = arg;
|
||||
unsigned char *buf = (unsigned char *) &rw->buffer[0];
|
||||
|
||||
if (rw->count == 1 && buf[0] < SC620_REG_COUNT) {
|
||||
int rv;
|
||||
|
||||
rv = rtems_libi2c_start_write_bytes(minor, buf, 1);
|
||||
if (rv == 1) {
|
||||
sc = rtems_libi2c_send_addr(minor, 0);
|
||||
if (sc == RTEMS_SUCCESSFUL) {
|
||||
rv = rtems_libi2c_read_bytes(minor, buf, 1);
|
||||
if (rv == 1) {
|
||||
sc = rtems_libi2c_send_stop(minor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rw->bytes_moved = sc == RTEMS_SUCCESSFUL ? 1 : 0;
|
||||
|
||||
return sc;
|
||||
}
|
||||
|
||||
static rtems_driver_address_table i2c_sc620_ops = {
|
||||
.read_entry = i2c_sc620_read,
|
||||
.write_entry = i2c_sc620_write
|
||||
};
|
||||
|
||||
rtems_libi2c_drv_t i2c_sc620_driver = {
|
||||
.ops = &i2c_sc620_ops,
|
||||
.size = sizeof(i2c_sc620_driver)
|
||||
};
|
||||
40
c/src/libchip/i2c/i2c-sc620.h
Normal file
40
c/src/libchip/i2c/i2c-sc620.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2013 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Dornierstr. 4
|
||||
* 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.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#ifndef I2C_SC620_H
|
||||
#define I2C_SC620_H
|
||||
|
||||
#include <rtems/libi2c.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @brief I2C driver for SEMTECH SC620 octal LED driver.
|
||||
*
|
||||
* A write() must use two character buffer. The buffer[0] value specifies the
|
||||
* register and the buffer[1] value specifies the register data.
|
||||
*
|
||||
* A read() must use a one character buffer. The buffer[0] value specifies the
|
||||
* register on function entry. The buffer[0] value contains the register value
|
||||
* after a successful operation.
|
||||
*/
|
||||
extern rtems_libi2c_drv_t i2c_sc620_driver;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* I2C_SC620_H */
|
||||
@@ -126,6 +126,10 @@ $(PROJECT_INCLUDE)/libchip/i2c-2b-eeprom.h: i2c/i2c-2b-eeprom.h $(PROJECT_INCLUD
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libchip/i2c-2b-eeprom.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libchip/i2c-2b-eeprom.h
|
||||
|
||||
$(PROJECT_INCLUDE)/libchip/i2c-sc620.h: i2c/i2c-sc620.h $(PROJECT_INCLUDE)/libchip/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libchip/i2c-sc620.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libchip/i2c-sc620.h
|
||||
|
||||
$(PROJECT_INCLUDE)/libchip/spi-memdrv.h: i2c/spi-memdrv.h $(PROJECT_INCLUDE)/libchip/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libchip/spi-memdrv.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libchip/spi-memdrv.h
|
||||
|
||||
@@ -42,7 +42,7 @@ if NEWLIB
|
||||
include_sysdir = $(includedir)/sys
|
||||
include_sys_HEADERS =
|
||||
|
||||
include_HEADERS += libnetworking/memory.h
|
||||
include_HEADERS += include/memory.h
|
||||
include_HEADERS += libmd/md4.h
|
||||
include_HEADERS += libmd/md5.h
|
||||
|
||||
@@ -55,7 +55,8 @@ include_sys_HEADERS += libcsupport/include/sys/ttycom.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/termios.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/utsname.h
|
||||
|
||||
include_sys_HEADERS += libnetworking/sys/uio.h
|
||||
include_sys_HEADERS += include/sys/uio.h
|
||||
include_sys_HEADERS += include/sys/_iovec.h
|
||||
include_sys_HEADERS += include/sys/priority.h
|
||||
|
||||
if LIBNETWORKING
|
||||
|
||||
@@ -1914,39 +1914,49 @@ session(rtems_task_argument arg)
|
||||
while(1)
|
||||
{
|
||||
rtems_event_set set;
|
||||
int rv;
|
||||
|
||||
rtems_event_receive(FTPD_RTEMS_EVENT, RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT,
|
||||
&set);
|
||||
|
||||
chroot_made = chroot_made || chroot(ftpd_root) == 0;
|
||||
|
||||
rv = chroot_made ? chdir("/") : -1;
|
||||
|
||||
errno = 0;
|
||||
|
||||
send_reply(info, 220, FTPD_SERVER_MESSAGE);
|
||||
|
||||
while (1)
|
||||
if (rv == 0)
|
||||
{
|
||||
char buf[FTPD_BUFSIZE];
|
||||
char *cmd, *opts, *args;
|
||||
send_reply(info, 220, FTPD_SERVER_MESSAGE);
|
||||
|
||||
if (fgets(buf, FTPD_BUFSIZE, info->ctrl_fp) == NULL)
|
||||
while (1)
|
||||
{
|
||||
syslog(LOG_INFO, "ftpd: Connection aborted.");
|
||||
break;
|
||||
}
|
||||
char buf[FTPD_BUFSIZE];
|
||||
char *cmd, *opts, *args;
|
||||
|
||||
split_command(buf, &cmd, &opts, &args);
|
||||
if (fgets(buf, FTPD_BUFSIZE, info->ctrl_fp) == NULL)
|
||||
{
|
||||
syslog(LOG_INFO, "ftpd: Connection aborted.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strcmp("QUIT", cmd))
|
||||
{
|
||||
send_reply(info, 221, "Goodbye.");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
exec_command(info, cmd, args);
|
||||
split_command(buf, &cmd, &opts, &args);
|
||||
|
||||
if (!strcmp("QUIT", cmd))
|
||||
{
|
||||
send_reply(info, 221, "Goodbye.");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
exec_command(info, cmd, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
send_reply(info, 421, "Service not available, closing control connection.");
|
||||
}
|
||||
|
||||
/* Close connection and put ourselves back into the task pool. */
|
||||
close_data_socket(info);
|
||||
@@ -1954,8 +1964,6 @@ session(rtems_task_argument arg)
|
||||
free(info->user);
|
||||
free(info->pass);
|
||||
task_pool_release(info);
|
||||
|
||||
chdir("/");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/bspIo.h
|
||||
*
|
||||
* @brief Interface to Kernel Print Methods
|
||||
*
|
||||
* This include file defines the interface to kernel print methods.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file rtems/btimer.h
|
||||
*
|
||||
* RTEMS benchmark timer API for all boards.
|
||||
* @brief RTEMS Benchmark Timer API for all Boards
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,7 +16,7 @@
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* All the functions declared as extern after this comment
|
||||
* MUST be implemented in each BSP.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/fs.h
|
||||
*
|
||||
* @brief Basic Filesystem Types
|
||||
*
|
||||
* This file defines basic filesystem types
|
||||
*/
|
||||
|
||||
|
||||
@@ -38,9 +38,8 @@ extern "C" {
|
||||
* In addition to the Classic API interrupt handler with a handle are
|
||||
* supported. You can also install multiple shared handler for one interrupt
|
||||
* vector.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Makes the interrupt handler unique. Prevents other handler from
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Header file for status checks.
|
||||
* @brief Header File for Status Checks
|
||||
*
|
||||
* @warning Do not include this file in other header files. Use it only in
|
||||
* source files.
|
||||
@@ -29,15 +29,13 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @defgroup rtems_status_checks Status Checks
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @name Print Macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief General purpose debug print macro.
|
||||
@@ -142,9 +140,8 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @name Check Macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Prints message @a msg and returns with status code @a sc if the status
|
||||
@@ -248,9 +245,8 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @name Cleanup Macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Prints message @a msg and jumps to @a label if the status code @a sc
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* @file
|
||||
*
|
||||
* @ingroup LibIOEnv
|
||||
* @brief User Environment Support
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -39,9 +40,8 @@ extern "C" {
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief Provides a POSIX like user environment for tasks.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#ifndef LOGIN_NAME_MAX
|
||||
#ifdef _POSIX_LOGIN_NAME_MAX
|
||||
|
||||
58
cpukit/include/sys/_iovec.h
Normal file
58
cpukit/include/sys/_iovec.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*
|
||||
* @(#)uio.h 8.5 (Berkeley) 2/22/94
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _SYS__IOVEC_HH_
|
||||
#define _SYS__IOVEC_HH_
|
||||
|
||||
#include <sys/_types.h>
|
||||
|
||||
#ifndef _SIZE_T_DECLARED
|
||||
typedef __size_t size_t;
|
||||
#define _SIZE_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifdef __rtems__
|
||||
#ifndef __IOVEC_DEFINED
|
||||
#define __IOVEC_DEFINED
|
||||
struct iovec {
|
||||
void *iov_base; /* Base address. */
|
||||
size_t iov_len; /* Length. */
|
||||
};
|
||||
#endif /* __IOVEC_DEFINED */
|
||||
#else
|
||||
struct iovec {
|
||||
void *iov_base; /* Base address. */
|
||||
size_t iov_len; /* Length. */
|
||||
};
|
||||
#endif /* rtems */
|
||||
|
||||
#endif /* !_SYS__IOVEC_HH_ */
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@@ -27,23 +27,30 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)uio.h 8.5 (Berkeley) 2/22/94
|
||||
* $FreeBSD: src/sys/sys/uio.h,v 1.40 2006/11/29 19:08:45 alfred Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SYS_UIO_H_
|
||||
#define _SYS_UIO_H_
|
||||
#ifndef _SYS_UIO_HH_
|
||||
#define _SYS_UIO_HH_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifdef __rtems__
|
||||
#include <sys/types.h>
|
||||
#endif /* __rtems__ */
|
||||
#include <sys/_types.h>
|
||||
#include <sys/_iovec.h>
|
||||
|
||||
/*
|
||||
* POSIX compliant iovec definition
|
||||
*/
|
||||
struct iovec {
|
||||
void *iov_base; /* pointer to data to be written */
|
||||
size_t iov_len; /* length of this data block */
|
||||
};
|
||||
#ifndef __rtems__
|
||||
#ifndef _SSIZE_T_DECLARED
|
||||
typedef __ssize_t ssize_t;
|
||||
#define _SSIZE_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _OFF_T_DECLARED
|
||||
typedef __off_t off_t;
|
||||
#define _OFF_T_DECLARED
|
||||
#endif
|
||||
#endif /* !__rtems__ */
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
enum uio_rw { UIO_READ, UIO_WRITE };
|
||||
@@ -65,11 +72,7 @@ struct uio {
|
||||
ssize_t uio_resid; /* remaining bytes to process */
|
||||
enum uio_seg uio_segflg; /* address space */
|
||||
enum uio_rw uio_rw; /* operation */
|
||||
#if !defined(__rtems__)
|
||||
struct thread *uio_td; /* owner */
|
||||
#else
|
||||
struct proc *uio_procp;
|
||||
#endif /* !__rtems__ */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -85,15 +88,37 @@ struct uio {
|
||||
*/
|
||||
#define UIO_MAXIOV 1024 /* max 1K of iov's */
|
||||
|
||||
struct vm_object;
|
||||
struct vm_page;
|
||||
|
||||
struct uio *cloneuio(struct uio *uiop);
|
||||
int copyinfrom(const void * __restrict src, void * __restrict dst,
|
||||
size_t len, int seg);
|
||||
int copyiniov(struct iovec *iovp, u_int iovcnt, struct iovec **iov,
|
||||
int error);
|
||||
int copyinstrfrom(const void * __restrict src, void * __restrict dst,
|
||||
size_t len, size_t * __restrict copied, int seg);
|
||||
int copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop);
|
||||
void uio_yield(void);
|
||||
int uiomove(void *cp, int n, struct uio *uio);
|
||||
int uiomove_frombuf(void *buf, int buflen, struct uio *uio);
|
||||
#ifndef __rtems__
|
||||
int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n,
|
||||
struct uio *uio);
|
||||
#endif /* !__rtems__ */
|
||||
int uiomoveco(void *cp, int n, struct uio *uio, int disposable);
|
||||
|
||||
#else /* !_KERNEL */
|
||||
|
||||
__BEGIN_DECLS
|
||||
ssize_t readv(int, const struct iovec *, int);
|
||||
ssize_t writev(int, const struct iovec *, int);
|
||||
#if __BSD_VISIBLE
|
||||
ssize_t preadv(int, const struct iovec *, int, off_t);
|
||||
ssize_t pwritev(int, const struct iovec *, int, off_t);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_SYS_UIO_H_ */
|
||||
#endif /* !_SYS_UIO_HH_ */
|
||||
@@ -2,8 +2,7 @@
|
||||
* @file
|
||||
*
|
||||
* @ingroup rtems_bdbuf
|
||||
*
|
||||
* Block device buffer management.
|
||||
* @brief Block Device Buffer Management
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -172,9 +171,8 @@ extern "C" {
|
||||
* issue with this design. The reallocation of a group may forced recently
|
||||
* accessed buffers out of the cache when they should not. The design should be
|
||||
* change to have groups on a LRU list if they have no buffers in use.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief State of a buffer of the cache.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* @ingroup rtems_bdpart
|
||||
*
|
||||
* Block device partition management.
|
||||
* @brief Block Device Partition Management
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -79,15 +79,13 @@ extern "C" {
|
||||
* - <a href="http://en.wikipedia.org/wiki/Extended_boot_record">Extended Boot Record</a>
|
||||
* - <a href="http://en.wikipedia.org/wiki/Cylinder-head-sector">Cylinder Head Sector</a>
|
||||
* - <a href="http://www.win.tue.nl/~aeb/partitions/partition_types-1.html">Partition Types</a>
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @name MBR Partition Types and Flags
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define RTEMS_BDPART_MBR_EMPTY 0x0U
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* @ingroup rtems_blkdev
|
||||
*
|
||||
* Block device management.
|
||||
* @brief Block Device Management
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -36,9 +36,8 @@ extern "C" {
|
||||
* control. This call puts IO @ref rtems_blkdev_request "requests" to the block
|
||||
* device for asynchronous processing. When a driver executes a request, it
|
||||
* invokes the request done callback function to finish the request.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Block device request type.
|
||||
@@ -175,9 +174,8 @@ static inline void rtems_blkdev_request_done(
|
||||
|
||||
/**
|
||||
* @name IO Control Request Codes
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define RTEMS_BLKIO_REQUEST _IOWR('B', 1, rtems_blkdev_request)
|
||||
#define RTEMS_BLKIO_GETMEDIABLKSIZE _IOR('B', 2, uint32_t)
|
||||
@@ -253,9 +251,8 @@ static inline int rtems_disk_fd_reset_device_stats(int fd)
|
||||
|
||||
/**
|
||||
* @name Block Device Driver Capabilities
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Only consecutive multi-sector buffer requests are supported.
|
||||
@@ -369,9 +366,8 @@ void rtems_blkstats(
|
||||
* @ingroup rtems_blkdev
|
||||
*
|
||||
* Generic disk device operations for standard RTEMS IO drivers.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* The device driver interface conventions suppose that a driver may contain an
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup rtems_disk
|
||||
* @brief Block Device Disk Management API
|
||||
*
|
||||
* @brief Block device disk management API.
|
||||
* @ingroup rtems_disk
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,9 +37,8 @@ typedef struct rtems_disk_device rtems_disk_device;
|
||||
* contain a subset of consecutive disk blocks. The logical disks are used to
|
||||
* represent the partitions of a disk. The disk devices are accessed via the
|
||||
* @ref rtems_bdbuf "block device buffer module".
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Block device block index type.
|
||||
@@ -94,7 +93,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Read hit count.
|
||||
*
|
||||
*
|
||||
* A read hit occurs in the rtems_bdbuf_read() function in case the block is
|
||||
* in the cached or modified state.
|
||||
*/
|
||||
@@ -102,7 +101,7 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @brief Read miss count.
|
||||
*
|
||||
*
|
||||
* A read miss occurs in the rtems_bdbuf_read() function in case the block is
|
||||
* in the empty state and a read transfer must be initiated to read the data
|
||||
* from the device.
|
||||
@@ -276,9 +275,8 @@ struct rtems_disk_device {
|
||||
|
||||
/**
|
||||
* @name Disk Device Data
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
static inline dev_t rtems_disk_get_device_identifier(
|
||||
const rtems_disk_device *dd
|
||||
@@ -340,9 +338,8 @@ static inline rtems_blkdev_bnum rtems_disk_get_block_count(
|
||||
|
||||
/**
|
||||
* @name Disk Device Maintainance
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Creates a physical disk with device identifier @a dev.
|
||||
@@ -443,9 +440,8 @@ rtems_status_code rtems_disk_release(rtems_disk_device *dd);
|
||||
|
||||
/**
|
||||
* @name Disk Management
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Initializes the disk device management.
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*
|
||||
* @ingroup RTEMSFDisk
|
||||
*
|
||||
* @brief Interface to a Flash Disk Block Device
|
||||
*
|
||||
* This file defines the interface to a flash disk block device.
|
||||
*/
|
||||
|
||||
@@ -116,9 +118,8 @@
|
||||
* }
|
||||
* close (fd);
|
||||
* @endcode
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief The base name of the flash disks.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file rtems/ide_part_table.h
|
||||
*
|
||||
* Support for "MS-DOS-style" partition tables
|
||||
* @file
|
||||
*
|
||||
* @brief "MS-DOS-style" Partition Tables Support
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -40,8 +40,8 @@ extern "C" {
|
||||
* actions. For example a disk attach will lead to inspection of the partition
|
||||
* table and mounted file systems. Clients can register listeners to react to
|
||||
* events.
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define RTEMS_MEDIA_MOUNT_BASE "/media"
|
||||
|
||||
@@ -312,9 +312,8 @@ typedef rtems_status_code (*rtems_media_worker)(
|
||||
|
||||
/**
|
||||
* @name Base
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Initializes the media manager.
|
||||
@@ -377,9 +376,8 @@ rtems_status_code rtems_media_post_event(
|
||||
|
||||
/**
|
||||
* @name Server
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Initializes the media manager and media server.
|
||||
@@ -452,9 +450,8 @@ static inline rtems_status_code rtems_media_server_disk_detach(
|
||||
|
||||
/**
|
||||
* @name Path Construction
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Creates a new path as "prefix/name-major".
|
||||
@@ -490,9 +487,8 @@ char *rtems_media_append_minor(
|
||||
|
||||
/**
|
||||
* @name Support
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Returns the device identifier for the device located at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file rtems/nvdisk.h
|
||||
*
|
||||
* Non-volatile disk block device implementation
|
||||
* @brief Non-volatile Disk Block Device Implementation
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup rtems_ramdisk
|
||||
*
|
||||
* @brief RAM disk block device API.
|
||||
* @brief RAM Disk Block Device API
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,14 +25,13 @@ extern "C" {
|
||||
*
|
||||
* @ingroup rtems_blkdev
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @name Static Configuration
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief RAM disk configuration table entry.
|
||||
@@ -97,9 +94,8 @@ rtems_device_driver ramdisk_initialize(
|
||||
|
||||
/**
|
||||
* @name Runtime Configuration
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief RAM disk descriptor.
|
||||
|
||||
@@ -37,8 +37,8 @@ extern "C" {
|
||||
*
|
||||
* @ingroup rtems_blkdev
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
typedef struct {
|
||||
rtems_blkdev_bnum block;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* @file rtems/clockdrv.h
|
||||
* @file
|
||||
*
|
||||
* @brief Clock Driver for all Boards
|
||||
*
|
||||
* This file describes the Clock Driver for all boards.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* @file rtems/console.h
|
||||
* @file
|
||||
*
|
||||
* @brief Console Driver for all Boards
|
||||
*
|
||||
* This file describes the Console Device Driver for all boards.
|
||||
* This driver provides support for the standard C Library.
|
||||
@@ -24,30 +26,29 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This macro defines the standard name for the console device
|
||||
* that is available to applications.
|
||||
* This macro defines the standard name for the console device
|
||||
* that is available to applications.
|
||||
*/
|
||||
#define CONSOLE_DEVICE_NAME "/dev/console"
|
||||
|
||||
/**
|
||||
* This macro defines the standard device driver table entry for
|
||||
* a console device driver.
|
||||
* This macro defines the standard device driver table entry for
|
||||
* a console device driver.
|
||||
*/
|
||||
#define CONSOLE_DRIVER_TABLE_ENTRY \
|
||||
{ console_initialize, console_open, console_close, \
|
||||
console_read, console_write, console_control }
|
||||
|
||||
/**
|
||||
* @brief Console Initialization Entry Point
|
||||
* @brief Console initialization entry point.
|
||||
*
|
||||
* This method initializes the console device driver.
|
||||
* This method initializes the console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
* @param[in] major is the device driver major number.
|
||||
* @param[in] minor is the device driver minor number.
|
||||
* @param[in] arg is the parameters to this call.
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device driver is successfully initialized.
|
||||
* @retval RTEMS_SUCCESSFUL The device driver is successfully initialized.
|
||||
*/
|
||||
rtems_device_driver console_initialize(
|
||||
rtems_device_major_number major,
|
||||
@@ -56,17 +57,16 @@ rtems_device_driver console_initialize(
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Console Open Entry Point
|
||||
* @brief Console open entry point.
|
||||
*
|
||||
* This method opens a specific device supported by the
|
||||
* console device driver.
|
||||
* This method opens a specific device supported by the
|
||||
* console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device driver is successfully opened.
|
||||
* @retval RTEMS_SUCCESSFUL The device driver is successfully opened.
|
||||
*/
|
||||
rtems_device_driver console_open(
|
||||
rtems_device_major_number major,
|
||||
@@ -75,17 +75,16 @@ rtems_device_driver console_open(
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Console Close Entry Point
|
||||
* @brief Console close entry point.
|
||||
*
|
||||
* This method closes a specific device supported by the
|
||||
* console device driver.
|
||||
* This method closes a specific device supported by the
|
||||
* console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device is successfully closed.
|
||||
* @retval RTEMS_SUCCESSFUL The device driver is successfully closed.
|
||||
*/
|
||||
rtems_device_driver console_close(
|
||||
rtems_device_major_number major,
|
||||
@@ -94,17 +93,16 @@ rtems_device_driver console_close(
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Console Read Entry Point
|
||||
* @brief Console read entry point.
|
||||
*
|
||||
* This method reads from a specific device supported by the
|
||||
* console device driver.
|
||||
* This method reads from a specific device supported by the
|
||||
* console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device is successfully read from.
|
||||
* @retval RTEMS_SUCCESSFUL The device is successfully read from.
|
||||
*/
|
||||
rtems_device_driver console_read(
|
||||
rtems_device_major_number major,
|
||||
@@ -113,17 +111,16 @@ rtems_device_driver console_read(
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Console Write Entry Point
|
||||
* @brief Console write entry point.
|
||||
*
|
||||
* This method writes to a specific device supported by the
|
||||
* console device driver.
|
||||
* This method writes to a specific device supported by the
|
||||
* console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device is successfully written.
|
||||
* @retval RTEMS_SUCCESSFUL The device is successfully written.
|
||||
*/
|
||||
rtems_device_driver console_write(
|
||||
rtems_device_major_number major,
|
||||
@@ -132,18 +129,17 @@ rtems_device_driver console_write(
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Console IO Control Entry Point
|
||||
* @brief Console IO control entry point.
|
||||
*
|
||||
* This method performs an IO Control operation on a
|
||||
* specific device supported by the console device driver.
|
||||
* This method performs an IO Control operation on a
|
||||
* specific device supported by the console device driver.
|
||||
*
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @return This method returns RTEMS_SUCCESSFUL when
|
||||
* the device driver IO control operation is
|
||||
* successfully performed.
|
||||
* @param[in] major is the device driver major number
|
||||
* @param[in] minor is the device driver minor number
|
||||
* @param[in] arg is the parameters to this call
|
||||
*
|
||||
* @retval RTEMS_SUCCESSFUL the device driver IO control operation is
|
||||
* successfully performed.
|
||||
*/
|
||||
rtems_device_driver console_control(
|
||||
rtems_device_major_number major,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* @file rtems/ringbuf.h
|
||||
* @file
|
||||
*
|
||||
* This file provides simple ring buffer functionality.
|
||||
* @brief Simple Ring Buffer Functionality
|
||||
*
|
||||
* This file provides simple ring buffer functionality.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Real-Time Clock Driver Interface
|
||||
*
|
||||
* Real-time clock driver interface.
|
||||
*/
|
||||
|
||||
@@ -27,9 +29,8 @@ extern "C" {
|
||||
*
|
||||
* This driver interface provides support to read and set the real-time clock
|
||||
* and to initialize the time of day for the system.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* Device file name path.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/assoc.h
|
||||
*
|
||||
* @brief RTEMS Associativity Routines
|
||||
*
|
||||
* RTEMS associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and vice-versa)
|
||||
*/
|
||||
@@ -10,7 +12,7 @@
|
||||
#define _RTEMS_RTEMS_ASSOC_H
|
||||
|
||||
/**
|
||||
* @defgroup Associativity Routines
|
||||
* @defgroup Associativity Associativity Routines
|
||||
*/
|
||||
/**@{*/
|
||||
|
||||
@@ -139,7 +141,7 @@ const rtems_assoc_t *rtems_assoc_ptr_by_local(
|
||||
|
||||
/**
|
||||
* @brief RTEMS Associate Bad Name
|
||||
*
|
||||
*
|
||||
* what to return if a value is not found
|
||||
* this is not reentrant, but it really shouldn't be invoked anyway
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file rtems/deviceio.h
|
||||
* @file
|
||||
*
|
||||
* @brief Map Operations on IMFS Device Nodes to the RTEMS Classic API IO Manager
|
||||
* @brief Operations on IMFS Device Nodes
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,24 +16,28 @@
|
||||
#ifndef _RTEMS_DEVICEIO_H
|
||||
#define _RTEMS_DEVICEIO_H
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
/**
|
||||
* @defgroup Device IO Handler
|
||||
* @defgroup IMFSDevices IMFS Device IO Handler
|
||||
*
|
||||
* @ingroup IMFS
|
||||
*
|
||||
* This contains the interface to device drivers using the RTEMS Classic API.
|
||||
*/
|
||||
/**@{*/
|
||||
|
||||
#include <rtems/libio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @brief IMFS Device Node Handlers
|
||||
* @brief IMFS device node handlers.
|
||||
*
|
||||
* IMFS Device Node Handlers
|
||||
* IMFS Device Node Handlers
|
||||
*
|
||||
* This file contains the set of handlers used to map operations on
|
||||
* IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
|
||||
* This file contains the set of handlers used to map operations on
|
||||
* IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
|
||||
*/
|
||||
int rtems_deviceio_errno( rtems_status_code status );
|
||||
|
||||
@@ -79,7 +83,8 @@ int rtems_deviceio_control(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
/* __cplusplus */
|
||||
|
||||
/**@}*/
|
||||
|
||||
#endif /* _RTEMS_DEVICEIO_H */
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/**
|
||||
* @file rtems/error.h
|
||||
*
|
||||
* @brief RTEMS Error Reporting
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
*
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
*
|
||||
* These routines provide general purpose error reporting.
|
||||
* rtems_error reports an error to stderr and allows use of
|
||||
* printf style formatting. A newline is appended to all messages.
|
||||
@@ -18,27 +20,32 @@
|
||||
* It can also include a rtems_status value which can be OR'd
|
||||
* with the above flags. *
|
||||
*
|
||||
* EXAMPLE
|
||||
* Example 1:
|
||||
* @code
|
||||
* #include <rtems.h>
|
||||
* #include <rtems/error.h>
|
||||
* rtems_error(0, "stray interrupt %d", intr);
|
||||
* @endcode
|
||||
*
|
||||
* EXAMPLE
|
||||
* Example 2:
|
||||
* @code
|
||||
* if ((status = rtems_task_create(...)) != RTEMS_SUCCCESSFUL)
|
||||
* {
|
||||
* rtems_error(status | RTEMS_ERROR_ABORT,
|
||||
* "could not create task");
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* EXAMPLE
|
||||
* Example 3:
|
||||
* @code
|
||||
* if ((fd = open(pathname, O_RDNLY)) < 0)
|
||||
* {
|
||||
* rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
|
||||
* goto failed;
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _RTEMS_RTEMS_ERROR_H
|
||||
#define _RTEMS_RTEMS_ERROR_H
|
||||
|
||||
@@ -53,11 +60,10 @@ extern "C" {
|
||||
* @defgroup ErrorPanicSupport Error And Panic Support
|
||||
*
|
||||
* @ingroup libcsupport
|
||||
*
|
||||
*
|
||||
* @brief Defines and externs for rtems error reporting
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
typedef Internal_errors_t rtems_error_code_t;
|
||||
|
||||
/*
|
||||
@@ -82,13 +88,13 @@ const char *rtems_status_text(rtems_status_code sc);
|
||||
|
||||
/**
|
||||
* @brief Report an Error
|
||||
*
|
||||
*
|
||||
* @param[in] error_code can be specified as any of the following:
|
||||
* RTEMS_ERROR_ERRNO -- include errno text in output
|
||||
* RTEMS_ERROR_PANIC -- halts local system after output
|
||||
* RTEMS_ERROR_ABORT -- abort after output
|
||||
*
|
||||
* @param[in] printf_format is a normal printf(3) format string,
|
||||
*
|
||||
* @param[in] printf_format is a normal printf(3) format string,
|
||||
* with its concommitant arguments
|
||||
*
|
||||
* @return the number of characters written.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/framebuffer.h
|
||||
*
|
||||
* @brief Frame Buffer Device Driver for all Boards
|
||||
*
|
||||
* This file describes the Frame Buffer Device Driver for all boards.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/libcsupport.h
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @brief Standard C Library Support
|
||||
*
|
||||
* This include file contains the information regarding the
|
||||
* RTEMS specific support for the standard C library.
|
||||
*/
|
||||
@@ -28,29 +30,31 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup libcsupport Standard C Library Support
|
||||
* @defgroup libcsupport Standard C Library Support
|
||||
*
|
||||
* @brief RTEMS Specific Support for the Standard C Library
|
||||
*
|
||||
* @brief RTEMS Specific Support for the Standard C Library
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
extern void malloc_dump(void);
|
||||
|
||||
/**
|
||||
* @brief Malloc Walk
|
||||
* @brief Malloc walk.
|
||||
*/
|
||||
extern bool malloc_walk(int source, bool printf_enabled);
|
||||
|
||||
/**
|
||||
* @brief RTEMS Malloc Set Heap Pointer
|
||||
* @brief Set malloc heap pointer.
|
||||
*
|
||||
* This routine is primarily used for debugging.
|
||||
* This routine is primarily used for debugging.
|
||||
*/
|
||||
void malloc_set_heap_pointer(Heap_Control *new_heap);
|
||||
|
||||
/**
|
||||
* @brief RTEMS Malloc Get Heap Pointer
|
||||
* @brief Get malloc heap pointer.
|
||||
*
|
||||
* This routine is primarily used for debugging.
|
||||
* This routine is primarily used for debugging.
|
||||
*/
|
||||
Heap_Control *malloc_get_heap_pointer( void );
|
||||
extern void libc_init(void);
|
||||
@@ -58,17 +62,17 @@ extern int host_errno(void);
|
||||
extern void fix_syscall_errno(void);
|
||||
|
||||
/**
|
||||
* @brief RTEMS Malloc Get Free Information
|
||||
* @brief Get free malloc information.
|
||||
*
|
||||
* Find amount of free heap remaining
|
||||
* Find amount of free heap remaining
|
||||
*/
|
||||
extern size_t malloc_free_space(void);
|
||||
extern void open_dev_console(void);
|
||||
|
||||
/**
|
||||
* @brief RTEMS Malloc Get Status Information
|
||||
* @brief Get malloc status information.
|
||||
*
|
||||
* Find amount of free heap remaining.
|
||||
* Find amount of free heap remaining.
|
||||
*/
|
||||
extern int malloc_info(Heap_Information_block *the_info);
|
||||
|
||||
@@ -163,8 +167,11 @@ void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot);
|
||||
/**
|
||||
* @brief Compares two resource snapshots for equality.
|
||||
*
|
||||
* @return Returns true if the resource snapshots are equal, and false
|
||||
* otherwise.
|
||||
* @param[in] a One resource snapshot.
|
||||
* @param[in] b Another resource snapshot.
|
||||
*
|
||||
* @retval true The resource snapshots are equal.
|
||||
* @retval false Otherwise.
|
||||
*
|
||||
* @see rtems_resource_snapshot_take().
|
||||
*/
|
||||
@@ -175,17 +182,20 @@ bool rtems_resource_snapshot_equal(
|
||||
|
||||
/**
|
||||
* @brief Takes a new resource snapshot and checks that it is equal to the
|
||||
* given snapshot.
|
||||
* given resource snapshot.
|
||||
*
|
||||
* @param[in] snapshot The snapshot used for comparison with the new snapshot.
|
||||
* @param[in] snapshot The resource snapshot used for comparison with the new
|
||||
* resource snapshot.
|
||||
*
|
||||
* @return Returns true if the resource snapshots are equal, and false
|
||||
* otherwise.
|
||||
* @retval true The resource snapshots are equal.
|
||||
* @retval false Otherwise.
|
||||
*
|
||||
* @see rtems_resource_snapshot_take().
|
||||
*/
|
||||
bool rtems_resource_snapshot_check(const rtems_resource_snapshot *snapshot);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief Basic IO API.
|
||||
*
|
||||
* @brief Basic IO API
|
||||
*
|
||||
* This file contains the support infrastructure used to manage the
|
||||
* table of integer style file descriptors used by the low level
|
||||
* POSIX system calls like open(), read, fstat(), etc.
|
||||
@@ -47,9 +47,8 @@ extern "C" {
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief File system operations.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief File system node types.
|
||||
@@ -749,9 +748,8 @@ int rtems_filesystem_default_statvfs(
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief File system node handler.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @brief Opens a node.
|
||||
@@ -1143,9 +1141,8 @@ int rtems_filesystem_default_fcntl(
|
||||
* system call behavior under RTEMS. Initially this supported only
|
||||
* IO to devices but has since been enhanced to support networking
|
||||
* and support for mounted file systems.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
typedef off_t rtems_off64_t __attribute__((deprecated));
|
||||
|
||||
@@ -1240,9 +1237,8 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @name Flag Values
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define LIBIO_FLAGS_NO_DELAY 0x0001U /* return immediately if no data */
|
||||
#define LIBIO_FLAGS_READ 0x0002U /* reading */
|
||||
@@ -1257,16 +1253,15 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @brief RTEMS LibIO Initialization
|
||||
*
|
||||
*
|
||||
* Called by BSP startup code to initialize the libio subsystem.
|
||||
*/
|
||||
void rtems_libio_init(void);
|
||||
|
||||
/**
|
||||
* @name External I/O Handlers
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
typedef int (*rtems_libio_open_t)(
|
||||
const char *pathname,
|
||||
@@ -1306,9 +1301,8 @@ typedef off_t (*rtems_libio_lseek_t)(
|
||||
|
||||
/**
|
||||
* @name Permission Macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/*
|
||||
* The following macros are used to build up the permissions sets
|
||||
@@ -1384,7 +1378,7 @@ static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
|
||||
|
||||
/**
|
||||
* @brief Base File System Initialization
|
||||
*
|
||||
*
|
||||
* Initialize the foundation of the file system. This is specified
|
||||
* by the structure rtems_filesystem_mount_table. The usual
|
||||
* configuration is a single instantiation of the IMFS or miniIMFS with
|
||||
@@ -1422,15 +1416,13 @@ extern int rtems_mkdir(const char *path, mode_t mode);
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief File system types and mount.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
/**
|
||||
* @name File System Types
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
|
||||
#define RTEMS_FILESYSTEM_TYPE_MINIIMFS "mimfs"
|
||||
@@ -1701,9 +1693,8 @@ extern const rtems_filesystem_mount_configuration
|
||||
* @ingroup LibIO
|
||||
*
|
||||
* @brief Termios
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
typedef struct rtems_termios_callbacks {
|
||||
int (*firstOpen)(int major, int minor, void *arg);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* @file rtems/libio_.h
|
||||
* @file
|
||||
*
|
||||
* @brief LibIO Internal Interface
|
||||
*
|
||||
* This file is the libio internal interface.
|
||||
*/
|
||||
|
||||
@@ -30,12 +32,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup LibIOInternal IO Internal Library
|
||||
* @defgroup LibIOInternal IO Internal Library
|
||||
*
|
||||
* @brief Internal IO library API and implementation.
|
||||
* @brief Internal IO library API and implementation.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
#define RTEMS_FILESYSTEM_SYMLOOP_MAX 32
|
||||
|
||||
@@ -69,8 +71,8 @@ extern rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry;
|
||||
* The purpose of this location is to deliver the error return status for a
|
||||
* previous error condition which must set the errno accordingly.
|
||||
*
|
||||
* The usage of this null location instead of the NULL pointer eliminates a lot
|
||||
* of branches.
|
||||
* The usage of this null location instead of the NULL pointer eliminates
|
||||
* a lot of branches.
|
||||
*
|
||||
* The user environment root and current directory are statically initialized
|
||||
* with the null location. Due to that all file system services are in a
|
||||
@@ -200,7 +202,7 @@ void rtems_filesystem_location_clone(
|
||||
*
|
||||
* @param[in] loc The location of the node.
|
||||
*
|
||||
* @return The node type.
|
||||
* @retval type The node type.
|
||||
*
|
||||
* @see rtems_filesystem_instance_lock().
|
||||
*/
|
||||
@@ -215,8 +217,8 @@ rtems_filesystem_node_types_t rtems_filesystem_node_type(
|
||||
*
|
||||
* @param[in] loc The location to free.
|
||||
*
|
||||
* @note The file system root location is released by the file system instance
|
||||
* destruction handler (see @ref rtems_filesystem_fsunmount_me_t).
|
||||
* @note The file system root location is released by the file system
|
||||
* instance destruction handler (see @ref rtems_filesystem_fsunmount_me_t).
|
||||
*
|
||||
* @see rtems_filesystem_freenode_t.
|
||||
*/
|
||||
@@ -277,24 +279,24 @@ static inline void rtems_filesystem_instance_unlock(
|
||||
*/
|
||||
|
||||
/**
|
||||
* This routine searches the IOP Table for an unused entry. If it
|
||||
* finds one, it returns it. Otherwise, it returns NULL.
|
||||
* This routine searches the IOP Table for an unused entry. If it
|
||||
* finds one, it returns it. Otherwise, it returns NULL.
|
||||
*/
|
||||
rtems_libio_t *rtems_libio_allocate(void);
|
||||
|
||||
/**
|
||||
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
|
||||
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
|
||||
*/
|
||||
uint32_t rtems_libio_fcntl_flags( int fcntl_flags );
|
||||
|
||||
/**
|
||||
* Convert RTEMS internal flags to UNIX fnctl(2) flags
|
||||
* Convert RTEMS internal flags to UNIX fnctl(2) flags
|
||||
*/
|
||||
int rtems_libio_to_fcntl_flags( uint32_t flags );
|
||||
|
||||
/**
|
||||
* This routine frees the resources associated with an IOP (file descriptor)
|
||||
* and clears the slot in the IOP Table.
|
||||
* This routine frees the resources associated with an IOP (file descriptor)
|
||||
* and clears the slot in the IOP Table.
|
||||
*/
|
||||
void rtems_libio_free(
|
||||
rtems_libio_t *iop
|
||||
@@ -359,7 +361,7 @@ void rtems_filesystem_eval_path_cleanup_with_parent(
|
||||
* current location. The previous start and current locations are released.
|
||||
*
|
||||
* @param[in, out] ctx The path evaluation context.
|
||||
* @param[in, out] newstartloc_ptr Pointer to new start location.
|
||||
* @param[in, out] newstartloc_ptr Pointer to the new start location.
|
||||
*/
|
||||
void rtems_filesystem_eval_path_restart(
|
||||
rtems_filesystem_eval_path_context_t *ctx,
|
||||
@@ -413,9 +415,6 @@ typedef struct {
|
||||
rtems_filesystem_eval_path_eval_token eval_token;
|
||||
} rtems_filesystem_eval_path_generic_config;
|
||||
|
||||
/**
|
||||
* @brief RTEMS File System Eval Generic Path
|
||||
*/
|
||||
void rtems_filesystem_eval_path_generic(
|
||||
rtems_filesystem_eval_path_context_t *ctx,
|
||||
void *arg,
|
||||
@@ -431,7 +430,7 @@ void rtems_filesystem_initialize(void);
|
||||
* corresponding mount entry.
|
||||
*
|
||||
* @param[out] dst The destination location.
|
||||
* @param[in] src The source location.
|
||||
* @param[in] src The source location.
|
||||
*
|
||||
* @retval dst The destination location.
|
||||
*
|
||||
@@ -552,9 +551,7 @@ static inline void rtems_filesystem_location_error(
|
||||
errno = eno;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief RTEMS File System Mknod
|
||||
*/
|
||||
|
||||
int rtems_filesystem_mknod(
|
||||
const rtems_filesystem_location_info_t *parentloc,
|
||||
const char *name,
|
||||
@@ -565,9 +562,6 @@ int rtems_filesystem_mknod(
|
||||
|
||||
int rtems_filesystem_chdir( rtems_filesystem_location_info_t *loc );
|
||||
|
||||
/**
|
||||
* @brief Change Owner and Group of a File
|
||||
*/
|
||||
int rtems_filesystem_chown(
|
||||
const char *path,
|
||||
uid_t owner,
|
||||
@@ -697,9 +691,6 @@ static inline void rtems_filesystem_eval_path_put_back_token(
|
||||
ctx->tokenlen = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RTEMS File System Eval Eat Delimiter Path
|
||||
*/
|
||||
void rtems_filesystem_eval_path_eat_delimiter(
|
||||
rtems_filesystem_eval_path_context_t *ctx
|
||||
);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/**
|
||||
* @file sys/statvfs.h
|
||||
* @file
|
||||
*
|
||||
* @brief Interface to the statvfs() Set of API Methods
|
||||
*
|
||||
* This include file defines the interface to the statvfs() set of
|
||||
* API methods. The statvfs as defined by the SUS:
|
||||
*
|
||||
* - http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html
|
||||
* - http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file sys/termios.h
|
||||
* @file
|
||||
*
|
||||
* @brief POSIX termios implementation for RTEMS console device driver.
|
||||
* @brief POSIX Termios Implementation for RTEMS Console Device Driver
|
||||
*
|
||||
* The Open Group Base Specifications Issue 6
|
||||
* IEEE Std 1003.1, 2004 Edition
|
||||
@@ -27,10 +27,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup Termios
|
||||
* @ingroup Termios
|
||||
*
|
||||
* @brief POSIX Termios Implementation
|
||||
* @brief POSIX Termios Implementation
|
||||
*
|
||||
*/
|
||||
/**@{**/
|
||||
|
||||
typedef unsigned char cc_t;
|
||||
typedef unsigned int speed_t;
|
||||
@@ -47,8 +49,8 @@ struct termios {
|
||||
};
|
||||
|
||||
/**
|
||||
* This value is used to disable processing of a member of c_cc
|
||||
* in the struct termios.
|
||||
* This value is used to disable processing of a member of c_cc
|
||||
* in the struct termios.
|
||||
*/
|
||||
#define _POSIX_VDISABLE 0
|
||||
|
||||
@@ -208,6 +210,8 @@ int cfsetospeed(struct termios *tp, speed_t speed);
|
||||
speed_t cfgetispeed(const struct termios *tp);
|
||||
int cfsetispeed(struct termios *tp, speed_t speed);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* @file sys/utsname.h
|
||||
* @file
|
||||
*
|
||||
* @brief Interface to the POSIX utsname() Service
|
||||
*
|
||||
* This include file defines the interface to the POSIX utsname() service.
|
||||
*/
|
||||
@@ -17,7 +19,9 @@
|
||||
#define __POSIX_SYS_UTSNAME_h
|
||||
|
||||
/**
|
||||
* @defgroup utsname Service
|
||||
* @defgroup UTSNAME utsname Service
|
||||
*
|
||||
* @ingroup POSIXAPI
|
||||
*/
|
||||
/**@{*/
|
||||
|
||||
@@ -43,7 +47,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct utsname {
|
||||
char sysname[SYS_NMLN]; /* Name of this implementation of the operating system */
|
||||
char sysname[SYS_NMLN]; /* Name of this implementation of the */
|
||||
/* operating system */
|
||||
char nodename[SYS_NMLN]; /* Name of this node within an implementation */
|
||||
/* specified communication network */
|
||||
char release[SYS_NMLN]; /* Current release level of this implementation */
|
||||
@@ -53,15 +58,19 @@ struct utsname {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 4.4.1 Get System Name, P1003.1b-1993, p. 90
|
||||
* @brief Get system name.
|
||||
*
|
||||
* 4.4.1 Get System Name, P1003.1b-1993, p. 90
|
||||
*/
|
||||
int uname(
|
||||
struct utsname *name
|
||||
);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* @file rtems/timerdrv.h
|
||||
* @file
|
||||
*
|
||||
* This file describes the Timer Driver for all boards.
|
||||
* @brief Timer Driver for all Boards
|
||||
*
|
||||
* This file describes the Timer Driver for all boards.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/**
|
||||
* @file rtems/vmeintr.h
|
||||
* @file
|
||||
*
|
||||
* @brief VMEbus Interface Library
|
||||
*
|
||||
* This file is the specification for the VMEbus interface library
|
||||
* which should be provided by all BSPs for VMEbus Single Board
|
||||
* Computers but currently only a few do so.
|
||||
* This file is the specification for the VMEbus interface library
|
||||
* which should be provided by all BSPs for VMEbus Single Board
|
||||
* Computers but currently only a few do so.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* @file rtems/zilog/z8036.h
|
||||
* @file
|
||||
*
|
||||
* @brief Zilog Z8036 Counter/Timer/IO Chip
|
||||
*
|
||||
* This include file defines information related to a Zilog Z8036
|
||||
* Counter/Timer/IO Chip. It is a memory mapped part.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file rtems/zilog/z8530.h
|
||||
* @file
|
||||
*
|
||||
* @brief Information Related to a Zilog Z8530 SCC Chip
|
||||
*
|
||||
* This include file defines information related to a Zilog Z8530
|
||||
* SCC Chip. It is a IO mapped part.
|
||||
* This include file defines information related to a Zilog Z8530
|
||||
* SCC Chip. It is a IO mapped part.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file rtems/zilog/z8536.h
|
||||
* @file
|
||||
*
|
||||
* @brief Information Related to a Zilog Z8536 Counter/Timer/IO Chip
|
||||
*
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
|
||||
/**
|
||||
* BSD 4.3 and SVR4 - Get File Status
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief RTEMS Default File System has nodes equal
|
||||
* @ingroup LibIOFSOps File System Operations
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief RTEMS Default File System Change Owner
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2010.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief RTEMS Default File System creates a child process
|
||||
* @ingroup LibIOFSOps File System Operations
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user