forked from Imagelibrary/rtems
2008-08-20 Sebastian Huber <sebastian.huber@embedded-brains.de>
* mpc55xx/fec/fec.c: Added copyright information. * mpc55xx/dspi/dspi.c, mpc55xx/edma/edma.c, mpc55xx/esci/esci.c: Fixed nexted extern declarations. Fixed integer conversion warnings. * shared/include/cpuIdent.c: Added missing initializers.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2008-08-20 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* mpc55xx/fec/fec.c: Added copyright information.
|
||||||
|
* mpc55xx/dspi/dspi.c, mpc55xx/edma/edma.c, mpc55xx/esci/esci.c:
|
||||||
|
Fixed nexted extern declarations. Fixed integer conversion warnings.
|
||||||
|
* shared/include/cpuIdent.c: Added missing initializers.
|
||||||
|
|
||||||
2008-08-20 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2008-08-20 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* mpc8260/clock/clock.c, mpc8260/console-generic/console-generic.c:
|
* mpc8260/clock/clock.c, mpc8260/console-generic/console-generic.c:
|
||||||
|
|||||||
@@ -317,12 +317,13 @@ static rtems_status_code mpc55xx_dspi_send_addr( rtems_libi2c_bus_t *bus, uint32
|
|||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME, TODO */
|
||||||
|
extern uint32_t bsp_clock_speed;
|
||||||
|
|
||||||
static int mpc55xx_dspi_set_transfer_mode( rtems_libi2c_bus_t *bus, const rtems_libi2c_tfr_mode_t *mode)
|
static int mpc55xx_dspi_set_transfer_mode( rtems_libi2c_bus_t *bus, const rtems_libi2c_tfr_mode_t *mode)
|
||||||
{
|
{
|
||||||
mpc55xx_dspi_bus_entry *e = (mpc55xx_dspi_bus_entry *) bus;
|
mpc55xx_dspi_bus_entry *e = (mpc55xx_dspi_bus_entry *) bus;
|
||||||
union DSPI_CTAR_tag ctar = MPC55XX_ZERO_FLAGS;
|
union DSPI_CTAR_tag ctar = MPC55XX_ZERO_FLAGS;
|
||||||
// FIXME, TODO
|
|
||||||
extern uint32_t bsp_clock_speed;
|
|
||||||
uint32_t scaler = bsp_clock_speed / mode->baudrate;
|
uint32_t scaler = bsp_clock_speed / mode->baudrate;
|
||||||
mpc55xx_dspi_baudrate_scaler_entry bse = mpc55xx_dspi_search_baudrate_scaler( scaler, 0, MPC55XX_DSPI_BAUDRATE_SCALER_TABLE_SIZE / 2, MPC55XX_DSPI_BAUDRATE_SCALER_TABLE_SIZE);
|
mpc55xx_dspi_baudrate_scaler_entry bse = mpc55xx_dspi_search_baudrate_scaler( scaler, 0, MPC55XX_DSPI_BAUDRATE_SCALER_TABLE_SIZE / 2, MPC55XX_DSPI_BAUDRATE_SCALER_TABLE_SIZE);
|
||||||
|
|
||||||
@@ -337,11 +338,6 @@ static int mpc55xx_dspi_set_transfer_mode( rtems_libi2c_bus_t *bus, const rtems_
|
|||||||
ctar.B.PBR = bse.pbr;
|
ctar.B.PBR = bse.pbr;
|
||||||
ctar.B.BR = bse.br;
|
ctar.B.BR = bse.br;
|
||||||
|
|
||||||
// ctar.B.PCSSCK = bse.pbr;
|
|
||||||
// ctar.B.CSSCK = bse.br;
|
|
||||||
// ctar.B.PASC = bse.pbr;
|
|
||||||
// ctar.B.ASC = bse.br;
|
|
||||||
|
|
||||||
ctar.B.PCSSCK = 0;
|
ctar.B.PCSSCK = 0;
|
||||||
ctar.B.CSSCK = 0;
|
ctar.B.CSSCK = 0;
|
||||||
ctar.B.PASC = 0;
|
ctar.B.PASC = 0;
|
||||||
@@ -425,8 +421,8 @@ static int mpc55xx_dspi_read_write( rtems_libi2c_bus_t *bus, unsigned char *in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (n > MPC55XX_DSPI_EDMA_MAGIC_SIZE) {
|
if (n > MPC55XX_DSPI_EDMA_MAGIC_SIZE) {
|
||||||
n_nc = mpc55xx_non_cache_aligned_size( in);
|
n_nc = (int) mpc55xx_non_cache_aligned_size( in);
|
||||||
n_c = mpc55xx_cache_aligned_size( in, n);
|
n_c = (int) mpc55xx_cache_aligned_size( in, (size_t) n);
|
||||||
if (n_c > EDMA_TCD_BITER_LINKED_SIZE) {
|
if (n_c > EDMA_TCD_BITER_LINKED_SIZE) {
|
||||||
SYSLOG_WARNING( "Buffer size out of range, cannot use eDMA\n");
|
SYSLOG_WARNING( "Buffer size out of range, cannot use eDMA\n");
|
||||||
n_nc = n;
|
n_nc = n;
|
||||||
@@ -462,8 +458,7 @@ static int mpc55xx_dspi_read_write( rtems_libi2c_bus_t *bus, unsigned char *in,
|
|||||||
/* Read */
|
/* Read */
|
||||||
if (r < n_nc && sr.B.RXCTR != 0) {
|
if (r < n_nc && sr.B.RXCTR != 0) {
|
||||||
pop_data.R = ppc_read_word( pop);
|
pop_data.R = ppc_read_word( pop);
|
||||||
in [r] = pop_data.B.RXDATA;
|
in [r] = (unsigned char) pop_data.B.RXDATA;
|
||||||
// printk( "[%03u]: 0x%02x -> 0x%02x\n", r, out [r], in [r]);
|
|
||||||
++r;
|
++r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -484,7 +479,6 @@ static int mpc55xx_dspi_read_write( rtems_libi2c_bus_t *bus, unsigned char *in,
|
|||||||
/* Read */
|
/* Read */
|
||||||
if (r < n_nc && sr.B.RXCTR != 0) {
|
if (r < n_nc && sr.B.RXCTR != 0) {
|
||||||
pop_data.R = ppc_read_word( pop);
|
pop_data.R = ppc_read_word( pop);
|
||||||
// printk( "[%03u]: 0x%02x -> 0x%02x\n", r, out [r], in [r]);
|
|
||||||
++r;
|
++r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -505,8 +499,7 @@ static int mpc55xx_dspi_read_write( rtems_libi2c_bus_t *bus, unsigned char *in,
|
|||||||
/* Read */
|
/* Read */
|
||||||
if (r < n_nc && sr.B.RXCTR != 0) {
|
if (r < n_nc && sr.B.RXCTR != 0) {
|
||||||
pop_data.R = ppc_read_word( pop);
|
pop_data.R = ppc_read_word( pop);
|
||||||
in [r] = pop_data.B.RXDATA;
|
in [r] = (unsigned char) pop_data.B.RXDATA;
|
||||||
// printk( "[%03u]: 0x%02x -> 0x%02x\n", r, out [r], in [r]);
|
|
||||||
++r;
|
++r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -521,8 +514,8 @@ static int mpc55xx_dspi_read_write( rtems_libi2c_bus_t *bus, unsigned char *in,
|
|||||||
struct tcd_t tcd_receive = MPC55XX_EDMA_TCD_DEFAULT;
|
struct tcd_t tcd_receive = MPC55XX_EDMA_TCD_DEFAULT;
|
||||||
|
|
||||||
/* Cache operations */
|
/* Cache operations */
|
||||||
rtems_cache_flush_multiple_data_lines( out_c, n_c);
|
rtems_cache_flush_multiple_data_lines( out_c, (size_t) n_c);
|
||||||
rtems_cache_invalidate_multiple_data_lines( in_c, n_c);
|
rtems_cache_invalidate_multiple_data_lines( in_c, (size_t) n_c);
|
||||||
|
|
||||||
/* Set transmit TCD */
|
/* Set transmit TCD */
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#include <rtems/status-checks.h>
|
#include <rtems/status-checks.h>
|
||||||
|
|
||||||
#define MPC55XX_EDMA_CHANNEL_NUMBER 64
|
#define MPC55XX_EDMA_CHANNEL_NUMBER 64
|
||||||
#define MPC55XX_EDMA_INVALID_CHANNEL -1
|
#define MPC55XX_EDMA_INVALID_CHANNEL UINT8_MAX
|
||||||
#define MPC55XX_EDMA_IS_CHANNEL_INVALID( i) ((i) < 0 || (i) >= MPC55XX_EDMA_CHANNEL_NUMBER)
|
#define MPC55XX_EDMA_IS_CHANNEL_INVALID( i) ((i) < 0 || (i) >= MPC55XX_EDMA_CHANNEL_NUMBER)
|
||||||
|
|
||||||
#define MPC55XX_EDMA_IRQ_PRIORITY MPC55XX_INTC_MIN_PRIORITY
|
#define MPC55XX_EDMA_IRQ_PRIORITY MPC55XX_INTC_MIN_PRIORITY
|
||||||
@@ -67,7 +67,7 @@ static void mpc55xx_edma_irq_handler( rtems_vector_number vector, void *data)
|
|||||||
SYSLOG_WARNING_SC( sc, "Transfer update semaphore release");
|
SYSLOG_WARNING_SC( sc, "Transfer update semaphore release");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mpc55xx_edma_irq_update_error_table( uint8_t *link_table, uint8_t *error_table, uint8_t channel)
|
static void mpc55xx_edma_irq_update_error_table( uint8_t *link_table, uint8_t *error_table, int channel)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
error_table [channel] = 1;
|
error_table [channel] = 1;
|
||||||
@@ -82,8 +82,8 @@ static void mpc55xx_edma_irq_error_handler( rtems_vector_number vector, void *da
|
|||||||
{
|
{
|
||||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
uint8_t channel_start = *((uint8_t *) data);
|
uint8_t channel_start = *((uint8_t *) data);
|
||||||
uint8_t channel_end = channel_start + 32;
|
uint8_t channel_end = (uint8_t) (channel_start + 32);
|
||||||
uint8_t i = 0;
|
int i = 0;
|
||||||
uint32_t mask = 0x1;
|
uint32_t mask = 0x1;
|
||||||
uint32_t error_register = 0;
|
uint32_t error_register = 0;
|
||||||
uint8_t channel_link_table [MPC55XX_EDMA_CHANNEL_NUMBER];
|
uint8_t channel_link_table [MPC55XX_EDMA_CHANNEL_NUMBER];
|
||||||
@@ -100,7 +100,7 @@ static void mpc55xx_edma_irq_error_handler( rtems_vector_number vector, void *da
|
|||||||
/* Fill channel link table */
|
/* Fill channel link table */
|
||||||
for (i = 0; i < MPC55XX_EDMA_CHANNEL_NUMBER; ++i) {
|
for (i = 0; i < MPC55XX_EDMA_CHANNEL_NUMBER; ++i) {
|
||||||
if (EDMA.TCD [i].BITERE_LINK && EDMA.TCD [i].CITER != EDMA.TCD [i].BITER) {
|
if (EDMA.TCD [i].BITERE_LINK && EDMA.TCD [i].CITER != EDMA.TCD [i].BITER) {
|
||||||
channel_link_table [i] = EDMA_TCD_BITER_LINK( i);
|
channel_link_table [i] = (uint8_t) EDMA_TCD_BITER_LINK( i);
|
||||||
} else if (EDMA.TCD [i].MAJORE_LINK && EDMA.TCD [i].CITER == EDMA.TCD [i].BITER) {
|
} else if (EDMA.TCD [i].MAJORE_LINK && EDMA.TCD [i].CITER == EDMA.TCD [i].BITER) {
|
||||||
channel_link_table [i] = EDMA.TCD [i].MAJORLINKCH;
|
channel_link_table [i] = EDMA.TCD [i].MAJORLINKCH;
|
||||||
} else {
|
} else {
|
||||||
@@ -135,7 +135,7 @@ static void mpc55xx_edma_irq_error_handler( rtems_vector_number vector, void *da
|
|||||||
/* Clear the error interrupt requests */
|
/* Clear the error interrupt requests */
|
||||||
for (i = 0; i < MPC55XX_EDMA_CHANNEL_NUMBER; ++i) {
|
for (i = 0; i < MPC55XX_EDMA_CHANNEL_NUMBER; ++i) {
|
||||||
if (channel_error_table [i]) {
|
if (channel_error_table [i]) {
|
||||||
EDMA.CER.R = i;
|
EDMA.CER.R = (uint8_t) i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,9 +146,9 @@ rtems_status_code mpc55xx_edma_enable_hardware_requests( int channel, bool enabl
|
|||||||
return RTEMS_INVALID_NUMBER;
|
return RTEMS_INVALID_NUMBER;
|
||||||
}
|
}
|
||||||
if (enable) {
|
if (enable) {
|
||||||
EDMA.SERQR.R = channel;
|
EDMA.SERQR.R = (uint8_t) channel;
|
||||||
} else {
|
} else {
|
||||||
EDMA.CERQR.R = channel;
|
EDMA.CERQR.R = (uint8_t) channel;
|
||||||
}
|
}
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,6 +257,9 @@ static int mpc55xx_esci_termios_write( int minor, const char *out, int n)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME, TODO */
|
||||||
|
extern uint32_t bsp_clock_speed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets attributes of port @a minor according to termios attributes @a t.
|
* @brief Sets attributes of port @a minor according to termios attributes @a t.
|
||||||
*
|
*
|
||||||
@@ -337,9 +340,6 @@ static int mpc55xx_esci_termios_set_attributes( int minor, const struct termios
|
|||||||
default: br = 0; break;
|
default: br = 0; break;
|
||||||
}
|
}
|
||||||
if (br > 0) {
|
if (br > 0) {
|
||||||
// FIXME, TODO
|
|
||||||
extern uint32_t bsp_clock_speed;
|
|
||||||
|
|
||||||
br = bsp_clock_speed / (16 * br);
|
br = bsp_clock_speed / (16 * br);
|
||||||
br = (br > 8191) ? 8191 : br;
|
br = (br > 8191) ? 8191 : br;
|
||||||
} else {
|
} else {
|
||||||
@@ -452,7 +452,7 @@ rtems_device_driver console_initialize( rtems_device_major_number major, rtems_d
|
|||||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
int console_done = 0;
|
int console_done = 0;
|
||||||
int termios_do_init = 1;
|
int termios_do_init = 1;
|
||||||
int i = 0;
|
rtems_device_minor_number i = 0;
|
||||||
mpc55xx_esci_driver_entry *e = NULL;
|
mpc55xx_esci_driver_entry *e = NULL;
|
||||||
|
|
||||||
for (i = 0; i < MPC55XX_ESCI_NUMBER; ++i) {
|
for (i = 0; i < MPC55XX_ESCI_NUMBER; ++i) {
|
||||||
@@ -488,7 +488,7 @@ rtems_device_driver console_initialize( rtems_device_major_number major, rtems_d
|
|||||||
CHECK_SC( sc, "Install IRQ handler");
|
CHECK_SC( sc, "Install IRQ handler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mpc55xx_esci_termios_set_attributes( minor, &mpc55xx_esci_termios_default);
|
mpc55xx_esci_termios_set_attributes( (int) i, &mpc55xx_esci_termios_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
@@ -613,7 +613,7 @@ rtems_device_driver console_control( rtems_device_major_number major, rtems_devi
|
|||||||
*
|
*
|
||||||
* The correct value will be set by mpc55xx_esci_output_char_init().
|
* The correct value will be set by mpc55xx_esci_output_char_init().
|
||||||
*/
|
*/
|
||||||
static unsigned mpc55xx_esci_output_char_minor = 0;
|
static int mpc55xx_esci_output_char_minor = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name BSP Character Output
|
* @name BSP Character Output
|
||||||
@@ -637,7 +637,7 @@ static void mpc55xx_esci_output_char_nop( char c)
|
|||||||
static void mpc55xx_esci_output_char_init( char c)
|
static void mpc55xx_esci_output_char_init( char c)
|
||||||
{
|
{
|
||||||
int console_found = 0;
|
int console_found = 0;
|
||||||
unsigned i = 0;
|
int i = 0;
|
||||||
for (i = 0; i < MPC55XX_ESCI_NUMBER; ++i) {
|
for (i = 0; i < MPC55XX_ESCI_NUMBER; ++i) {
|
||||||
if (mpc55xx_esci_driver_table [i].console) {
|
if (mpc55xx_esci_driver_table [i].console) {
|
||||||
console_found = 1;
|
console_found = 1;
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
*
|
*
|
||||||
* @ingroup mpc55xx
|
* @ingroup mpc55xx
|
||||||
*
|
*
|
||||||
* @brief Device driver for the Fast Ethernet Controller
|
* @brief Empty file.
|
||||||
*
|
*/
|
||||||
* @par Copyright
|
|
||||||
* Copyright (c) 2008<br>
|
/*
|
||||||
* Embedded Brains GmbH<br>
|
* Copyright (c) 2008
|
||||||
* Obere Lagerstr. 30<br>
|
* Embedded Brains GmbH
|
||||||
* D-82178 Puchheim<br>
|
* Obere Lagerstr. 30
|
||||||
* Germany<br>
|
* D-82178 Puchheim
|
||||||
* rtems@embedded-brains.de<br>
|
* Germany
|
||||||
|
* rtems@embedded-brains.de
|
||||||
*
|
*
|
||||||
* @par License
|
|
||||||
* The license and distribution terms for this file may be found in the file
|
* 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.
|
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -49,16 +49,16 @@ rtems_status_code mpc83xx_gtm_initialize( int timer, int clock)
|
|||||||
|
|
||||||
MPC83XX_GTM_VARIABLES( timer);
|
MPC83XX_GTM_VARIABLES( timer);
|
||||||
|
|
||||||
uint8_t mask = 0xf << (low * 4);
|
unsigned mask = 0xfU << (low * 4);
|
||||||
uint8_t flags = 0x3 << (low * 4);
|
unsigned flags = 0x3U << (low * 4);
|
||||||
uint16_t reg = 0;
|
uint8_t reg = 0;
|
||||||
|
|
||||||
MPC83XX_GTM_CHECK_INDEX( timer);
|
MPC83XX_GTM_CHECK_INDEX( timer);
|
||||||
|
|
||||||
rtems_interrupt_disable( level);
|
rtems_interrupt_disable( level);
|
||||||
|
|
||||||
reg = mpc83xx.gtm [module].gtcfr [high].reg;
|
reg = mpc83xx.gtm [module].gtcfr [high].reg;
|
||||||
mpc83xx.gtm [module].gtcfr [high].reg = (reg & ~mask) | flags;
|
mpc83xx.gtm [module].gtcfr [high].reg = (uint8_t) ((reg & ~mask) | flags);
|
||||||
|
|
||||||
mpc83xx.gtm [module].gt_tim_regs [high].gtmdr [low] = 0;
|
mpc83xx.gtm [module].gt_tim_regs [high].gtmdr [low] = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,18 @@ SPR_RO(PVR)
|
|||||||
|
|
||||||
ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;
|
ppc_cpu_id_t current_ppc_cpu = PPC_UNKNOWN;
|
||||||
ppc_cpu_revision_t current_ppc_revision = 0xff;
|
ppc_cpu_revision_t current_ppc_revision = 0xff;
|
||||||
ppc_feature_t current_ppc_features = {0};
|
ppc_feature_t current_ppc_features = {
|
||||||
|
.has_altivec = 0,
|
||||||
|
.has_fpu = 0,
|
||||||
|
.has_hw_ptbl_lkup = 0,
|
||||||
|
.is_bookE = 0,
|
||||||
|
.has_16byte_clne = 0,
|
||||||
|
.is_60x = 0,
|
||||||
|
.has_8_bats = 0,
|
||||||
|
.has_epic = 0,
|
||||||
|
.has_shadowed_gprs = 0,
|
||||||
|
.has_ivpr_and_ivor = 0
|
||||||
|
};
|
||||||
|
|
||||||
char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu)
|
char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user