* mpc55xx/include/fsl-mpc551x.h, mpc55xx/include/fsl-mpc555x.h,
	mpc55xx/include/fsl-mpc556x.h, mpc55xx/include/fsl-mpc567x.h,
	mpc55xx/include/regs-edma.h, mpc55xx/include/regs-mmu.h: New files.
	* Makefile.am, M preinstall.am: Reflect changes above.
	* mpc55xx/dspi/dspi.c: Update due to API changes.
	* mpc55xx/include/edma.h, mpc55xx/edma/edma.c: Rework to support
	multiple eDMA modules.  Removed complex error interrupt handling.
	* mpc55xx/include/esci.h, mpc55xx/esci/esci.c: Support interrupt mode
	and printk().  Use configure options.
	* mpc55xx/include/irq.h: More defines.  API changes.
	* mpc55xx/include/mpc55xx.h: API changes.
	* mpc55xx/include/reg-defs.h: Added register defines.
	* mpc55xx/include/regs.h: Use new register header files.
	* mpc55xx/include/siu.h: Fixed includes.
	* mpc55xx/misc/fmpll.S, mpc55xx/misc/copy.S, mpc55xx/misc/flash.S:
	Changed sections.  API changes. Support MPC5674F.
This commit is contained in:
Sebastian Huber committed 2011-08-31 15:50:30 +00:00
1 parent b2aa729698
commit 97fa2f1b1e
22 files changed
+20168 -5042

No files matched your search

+19
View File
@@ -1,3 +1,22 @@
2011-08-31 Sebastian Huber <sebastian.huber@embedded-brains.de>
* mpc55xx/include/fsl-mpc551x.h, mpc55xx/include/fsl-mpc555x.h,
mpc55xx/include/fsl-mpc556x.h, mpc55xx/include/fsl-mpc567x.h,
mpc55xx/include/regs-edma.h, mpc55xx/include/regs-mmu.h: New files.
* Makefile.am, M preinstall.am: Reflect changes above.
* mpc55xx/dspi/dspi.c: Update due to API changes.
* mpc55xx/include/edma.h, mpc55xx/edma/edma.c: Rework to support
multiple eDMA modules. Removed complex error interrupt handling.
* mpc55xx/include/esci.h, mpc55xx/esci/esci.c: Support interrupt mode
and printk(). Use configure options.
* mpc55xx/include/irq.h: More defines. API changes.
* mpc55xx/include/mpc55xx.h: API changes.
* mpc55xx/include/reg-defs.h: Added register defines.
* mpc55xx/include/regs.h: Use new register header files.
* mpc55xx/include/siu.h: Fixed includes.
* mpc55xx/misc/fmpll.S, mpc55xx/misc/copy.S, mpc55xx/misc/flash.S:
Changed sections. API changes. Support MPC5674F.
2011-08-31 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_categories.c,
+17 -9
View File
@@ -411,15 +411,23 @@ if mpc55xx
# Includes
include_mpc55xxdir = $(includedir)/mpc55xx
include_mpc55xx_HEADERS = mpc55xx/include/regs.h \
mpc55xx/include/reg-defs.h \
mpc55xx/include/dspi.h \
mpc55xx/include/edma.h \
mpc55xx/include/emios.h \
mpc55xx/include/mpc55xx.h \
mpc55xx/include/esci.h \
mpc55xx/include/siu.h \
mpc55xx/include/watchdog.h
include_mpc55xx_HEADERS =
include_mpc55xx_HEADERS += mpc55xx/include/regs.h
include_mpc55xx_HEADERS += mpc55xx/include/reg-defs.h
include_mpc55xx_HEADERS += mpc55xx/include/dspi.h
include_mpc55xx_HEADERS += mpc55xx/include/edma.h
include_mpc55xx_HEADERS += mpc55xx/include/emios.h
include_mpc55xx_HEADERS += mpc55xx/include/mpc55xx.h
include_mpc55xx_HEADERS += mpc55xx/include/esci.h
include_mpc55xx_HEADERS += mpc55xx/include/siu.h
include_mpc55xx_HEADERS += mpc55xx/include/irq.h
include_mpc55xx_HEADERS += mpc55xx/include/watchdog.h
include_mpc55xx_HEADERS += mpc55xx/include/fsl-mpc551x.h
include_mpc55xx_HEADERS += mpc55xx/include/fsl-mpc555x.h
include_mpc55xx_HEADERS += mpc55xx/include/fsl-mpc556x.h
include_mpc55xx_HEADERS += mpc55xx/include/fsl-mpc567x.h
include_mpc55xx_HEADERS += mpc55xx/include/regs-edma.h
include_mpc55xx_HEADERS += mpc55xx/include/regs-mmu.h
include_bsp_HEADERS += mpc55xx/include/irq.h
+5 -3
View File
@@ -22,6 +22,8 @@
#include <mpc55xx/dspi.h>
#include <mpc55xx/mpc55xx.h>
#include <bsp/irq.h>
#include <libcpu/powerpc-utility.h>
#define RTEMS_STATUS_CHECKS_USE_PRINTK
@@ -172,7 +174,7 @@ static rtems_status_code mpc55xx_dspi_init( rtems_libi2c_bus_t *bus)
);
RTEMS_CHECK_SC( sc, "create receive update semaphore");
sc = mpc55xx_edma_obtain_channel( &e->edma_receive);
sc = mpc55xx_edma_obtain_channel( &e->edma_receive, MPC55XX_INTC_DEFAULT_PRIORITY);
RTEMS_CHECK_SC( sc, "obtain receive eDMA channel");
/* eDMA transmit */
@@ -185,10 +187,10 @@ static rtems_status_code mpc55xx_dspi_init( rtems_libi2c_bus_t *bus)
);
RTEMS_CHECK_SC( sc, "create transmit update semaphore");
sc = mpc55xx_edma_obtain_channel( &e->edma_transmit);
sc = mpc55xx_edma_obtain_channel( &e->edma_transmit, MPC55XX_INTC_DEFAULT_PRIORITY);
RTEMS_CHECK_SC( sc, "obtain transmit eDMA channel");
sc = mpc55xx_edma_obtain_channel( &e->edma_push);
sc = mpc55xx_edma_obtain_channel( &e->edma_push, MPC55XX_INTC_DEFAULT_PRIORITY);
RTEMS_CHECK_SC( sc, "obtain push eDMA channel");
tcd_push.SADDR = mpc55xx_dspi_push_data_address( e);
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -32,17 +32,17 @@ extern "C" {
#endif /* __cplusplus */
typedef struct mpc55xx_edma_channel_entry {
rtems_chain_node node;
unsigned channel;
void (*done)( struct mpc55xx_edma_channel_entry *, uint32_t);
rtems_id id;
rtems_chain_node node;
unsigned channel;
void (*done)( struct mpc55xx_edma_channel_entry *, uint32_t);
rtems_id id;
} mpc55xx_edma_channel_entry;
rtems_status_code mpc55xx_edma_init();
void mpc55xx_edma_init(void);
rtems_status_code mpc55xx_edma_obtain_channel( mpc55xx_edma_channel_entry *e);
rtems_status_code mpc55xx_edma_obtain_channel( mpc55xx_edma_channel_entry *e, unsigned irq_priority);
rtems_status_code mpc55xx_edma_release_channel( mpc55xx_edma_channel_entry *e);
void mpc55xx_edma_release_channel( mpc55xx_edma_channel_entry *e);
void mpc55xx_edma_enable_hardware_requests( unsigned channel, bool enable);
@@ -27,6 +27,7 @@
#ifndef LIBCPU_POWERPC_MPC55XX_ESCI_H
#define LIBCPU_POWERPC_MPC55XX_ESCI_H
#include <rtems.h>
#include <rtems/termiostypes.h>
#ifdef __cplusplus
@@ -35,16 +36,15 @@ extern "C" {
#define MPC55XX_ESCI_NUMBER 2
struct ESCI_tag;
typedef struct {
volatile struct ESCI_tag *regs;
const char *device_name;
int use_termios;
int use_interrupts;
int console;
struct rtems_termios_tty *tty;
unsigned irq_number;
const char *device_name;
rtems_vector_number irq_number;
int transmit_nest_level;
bool transmit_in_progress;
bool use_termios;
bool use_interrupts;
} mpc55xx_esci_driver_entry;
extern mpc55xx_esci_driver_entry mpc55xx_esci_driver_table [ /* MPC55XX_ESCI_NUMBER */ ];
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -7,15 +7,19 @@
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
* 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.
*
* $Id$
*/
/**
@@ -43,23 +47,11 @@
#include <stddef.h>
#include <stdint.h>
/* Defined in copy.S */
int mpc55xx_copy_8( const void *src, void *dest, size_t n);
/* Defined in fmpll.S */
int mpc55xx_get_system_clock(void);
/* Defined in fmpll.S */
void mpc55xx_fmpll_reset_config();
/* Defined in fmpll.S */
void mpc55xx_fmpll_wait_for_lock();
/* Defined in fmpll.S */
int mpc55xx_get_system_clock();
/* Defined in fmpll.S */
void mpc55xx_system_reset();
/* Defined in flash.S */
void mpc55xx_flash_config();
void mpc55xx_system_reset(void);
int mpc55xx_flash_copy(void *dest, const void *src, size_t nbytes);
int mpc55xx_flash_copy_op(void *rdest, const void *src, size_t nbytes,
@@ -7,15 +7,19 @@
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
* 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.
*
* $Id$
*/
#ifndef LIBCPU_POWERPC_MPC55XX_REG_DEFS_H
@@ -47,9 +51,12 @@
#define FMPLL_SYNCR 0xC3F80000
#define FMPLL_SYNSR 0xC3F80004
#define FMPLL_ESYNCR1 0XC3F80008
#define FMPLL_ESYNCR2 0XC3F8000C
#define FLASH_BIUCR 0xC3F8801C
#define SIU_ECCR 0xC3F90984
#define SIU_SRCR 0xC3F90010
#define SIU_SYSDIV 0xC3F909A0
#endif /*((MPC55XX_CHIP_TYPE >= 5510) && (MPC55XX_CHIP_TYPE <= 5517))*/
/*
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,172 @@
/**
* @file
*
* @ingroup mpc55xx
*/
/*
* Copyright (c) 2008-2011 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.
*/
/*********************************************************************
*
* Copyright:
* Freescale Semiconductor, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Freescale
* Semiconductor, Inc. This software is provided on an "AS IS"
* basis and without warranty.
*
* To the maximum extent permitted by applicable law, Freescale
* Semiconductor DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
* INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
* PARTICULAR PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
* REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
* AND ANY ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL Freescale Semiconductor BE LIABLE FOR ANY DAMAGES WHATSOEVER
* (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
* BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
* PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Freescale Semiconductor assumes no responsibility for the
* maintenance and support of this software
*
********************************************************************/
#ifndef LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
#define LIBCPU_POWERPC_MPC55XX_REGS_MMU_H
#include <stdint.h>
#include <bspopts.h>
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************/
/* MMU */
/****************************************************************************/
struct MMU_tag {
union {
uint32_t R;
struct {
uint32_t : 2;
uint32_t TLBSEL : 2;
uint32_t : 7;
uint32_t ESEL : 5;
uint32_t : 11;
uint32_t NV : 5;
} B;
} MAS0;
union {
uint32_t R;
struct {
uint32_t VALID : 1;
uint32_t IPROT : 1;
uint32_t : 6;
uint32_t TID : 8;
uint32_t : 3;
uint32_t TS : 1;
uint32_t TSIZE : 5;
uint32_t : 7;
} B;
} MAS1;
union {
uint32_t R;
struct {
uint32_t EPN : 22;
uint32_t : 4;
uint32_t VLE : 1;
uint32_t W : 1;
uint32_t I : 1;
uint32_t M : 1;
uint32_t G : 1;
uint32_t E : 1;
} B;
} MAS2;
union {
uint32_t R;
struct {
uint32_t RPN : 22;
uint32_t U0 : 1;
uint32_t U1 : 1;
uint32_t U2 : 1;
uint32_t U3 : 1;
uint32_t UX : 1;
uint32_t SX : 1;
uint32_t UW : 1;
uint32_t SW : 1;
uint32_t UR : 1;
uint32_t SR : 1;
} B;
} MAS3;
};
union MMU_MAS4_tag {
uint32_t R;
struct {
uint32_t : 2;
uint32_t TLBSELD : 2;
uint32_t : 10;
uint32_t TIDSELD : 2;
uint32_t : 4;
uint32_t TSIZED : 4;
uint32_t : 3;
uint32_t WD : 1;
uint32_t ID : 1;
uint32_t MD : 1;
uint32_t GD : 1;
uint32_t ED : 1;
} B;
};
union MMU_MAS6_tag {
uint32_t R;
struct {
uint32_t : 8;
uint32_t SPID : 8;
uint32_t : 15;
uint32_t SAS : 1;
} B;
};
#define MPC55XX_MMU_TAG_INITIALIZER(idx, addr, size, x, w, r, io) \
{ \
.MAS0 = { .B = { .TLBSEL = 1, .ESEL = (idx) } }, \
.MAS1 = { .B = { \
.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 } \
}, \
.MAS3 = { .B = { \
.RPN = (addr) >> 10, .U0 = 0, .U1 = 0, .U2 = 0, .U3 = 0, .UX = 0, \
.SX = (x), .UW = 0, .SW = (w), .UR = 0, .SR = (r) } \
} \
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBCPU_POWERPC_MPC55XX_REGS_MMU_H */
File diff suppressed because it is too large. Load diff
+12 -12
View File
@@ -7,25 +7,25 @@
*/
/*
* Copyright (c) 2010
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
* Copyright (c) 2010-2011 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
* 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.
*/
#ifndef LIBCPU_POWERPC_MPC55XX_SIU_H
#define LIBCPU_POWERPC_MPC55XX_SIU_H
#include <stdbool.h>
#include <stdint.h>
#include <rtems.h>
#include <rtems/chain.h>
#include <mpc55xx/regs.h>
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -21,7 +21,7 @@
#include <libcpu/powerpc-utility.h>
#include <bspopts.h>
.section ".text"
.section ".bsp_start_text", "ax"
/**
* @fn int mpc55xx_copy_8( const void *src, void *dest, size_t n)
+22 -11
View File
@@ -7,36 +7,41 @@
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
* 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.
*
* $Id$
*/
#include <libcpu/powerpc-utility.h>
#include <mpc55xx/reg-defs.h>
.section ".text"
.section ".bsp_start_text", "ax"
/* Optimized flash configurations (Table 13-15 [MPC5567 Microcontroller Reference Manual]) */
.equ FLASH_SETTINGS_RESET, 0xff00
.equ FLASH_SETTINGS_82, FLASH_BUICR_CPU_PREFTCH | FLASH_BUICR_APC_1 | FLASH_BUICR_RWSC_1 | FLASH_BUICR_WWSC_1 | FLASH_BUICR_DPFEN_3 | FLASH_BUICR_IPFEN_3 | FLASH_BUICR_PFLIM_6 | FLASH_BUICR_BFEN
.equ FLASH_SETTINGS_102, FLASH_BUICR_CPU_PREFTCH | FLASH_BUICR_APC_1 | FLASH_BUICR_RWSC_2 | FLASH_BUICR_WWSC_1 | FLASH_BUICR_DPFEN_3 | FLASH_BUICR_IPFEN_3 | FLASH_BUICR_PFLIM_6 | FLASH_BUICR_BFEN
.equ FLASH_SETTINGS_132, FLASH_BUICR_CPU_PREFTCH | FLASH_BUICR_APC_2 | FLASH_BUICR_RWSC_3 | FLASH_BUICR_WWSC_1 | FLASH_BUICR_DPFEN_3 | FLASH_BUICR_IPFEN_3 | FLASH_BUICR_PFLIM_6 | FLASH_BUICR_BFEN
.equ FLASH_SETTINGS_264, 0x01716B15
/**
* @fn void mpc55xx_flash_config()
* @fn void mpc55xx_flash_init()
* @brief Optimized flash configuration.
* @warning Code will be copied and executed on the stack. The stack pointer
* will not be updated, since this function has to work before memory
* initialization.
*/
GLOBAL_FUNCTION mpc55xx_flash_config
GLOBAL_FUNCTION mpc55xx_flash_init
mflr r31
/* Flash settings dependent on system clock */
@@ -50,6 +55,9 @@ GLOBAL_FUNCTION mpc55xx_flash_config
LWI r4, 132000000
cmpw r3, r4
ble clock_132
LWI r4, 264000000
cmpw r3, r4
ble clock_264
LWI r30, FLASH_SETTINGS_RESET
b settings_done
clock_82:
@@ -61,6 +69,9 @@ clock_102:
clock_132:
LWI r30, FLASH_SETTINGS_132
b settings_done
clock_264:
LWI r30, FLASH_SETTINGS_264
b settings_done
settings_done:
/* Copy store code on the stack */
+34 -29
View File
@@ -7,22 +7,32 @@
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
* Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
* 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.
*
* $Id$
*/
#include <libcpu/powerpc-utility.h>
#include <mpc55xx/reg-defs.h>
#include <bspopts.h>
#define FMPLL_IS_MPC551X (5510 <= MPC55XX_CHIP_TYPE && MPC55XX_CHIP_TYPE <= 5517)
#define FMPLL_IS_MPC5674 (MPC55XX_CHIP_TYPE == 5674)
#define FMPLL_HAS_ENHANCED_FMPLL (FMPLL_IS_MPC551X || FMPLL_IS_MPC5674)
.section ".text"
.section ".bsp_start_text", "ax"
/* Timeout for delay in clocks */
.equ FMPLL_TIMEOUT, 6000
@@ -31,20 +41,18 @@
lwz r5, \setting
stw r5, 0(r4)
msync
bl mpc55xx_fmpll_wait_for_lock
bl fmpll_wait_for_lock
.endm
/**
* @fn void mpc55xx_fmpll_reset_config()
* @fn void mpc55xx_fmpll_init()
* @brief Configure FMPLL after reset.
*
* Sets the system clock from 12 MHz in two steps up to 128 MHz.
*/
GLOBAL_FUNCTION mpc55xx_fmpll_reset_config
GLOBAL_FUNCTION mpc55xx_fmpll_init
/* Save link register */
mflr r9
#if ((MPC55XX_CHIP_TYPE >= 5510) && (MPC55XX_CHIP_TYPE <= 5517))
#if FMPLL_HAS_ENHANCED_FMPLL
/*
* for MPC5510: pass in ptr to array with:
* off 0: temp setting for ESYNCR2
@@ -60,10 +68,11 @@ GLOBAL_FUNCTION mpc55xx_fmpll_reset_config
lwz r5, 8(r3)
stw r5, (FMPLL_ESYNCR1-FMPLL_ESYNCR2)(r4)
msync
bl mpc55xx_fmpll_wait_for_lock
bl fmpll_wait_for_lock
DO_SETTING 4(r3)
#if FMPLL_IS_MPC551X
/*
* switch to PLL clock in SIU
*/
@@ -74,7 +83,8 @@ GLOBAL_FUNCTION mpc55xx_fmpll_reset_config
LWI r6, SIU_SYSCLK_SYSCLKSEL_PLL
or r5, r5, r6
stw r5, 0(r4)
#else
#endif /* FMPLL_IS_MPC551X */
#else /* !FMPLL_HAS_ENHANCED_FMPLL */
/*
* for MPC5566: pass in ptr to array with:
* off 0: temp setting for SYNCR
@@ -95,19 +105,13 @@ GLOBAL_FUNCTION mpc55xx_fmpll_reset_config
LWI r6, ~FMPLL_SYNCR_LOCRE & ~FMPLL_SYNCR_LOLRE
and r5, r5, r6
stw r5, 0(r4)
#endif
#endif /* !FMPLL_HAS_ENHANCED_FMPLL */
/* Restore link register and return */
mtlr r9
blr
/**
* @fn void mpc55xx_fmpll_wait_for_lock()
* @brief Wait for FMPLL lock.
* @warning If the lock cannot be obtained within some clock cycles a software
* system reset will be initiated.
*/
GLOBAL_FUNCTION mpc55xx_fmpll_wait_for_lock
fmpll_wait_for_lock:
LWI r6, FMPLL_TIMEOUT
mtctr r6
@@ -126,12 +130,14 @@ fmpll_continue:
blr
.section ".text", "aw"
/**
* @fn int mpc55xx_get_system_clock()
* @brief Returns the system clock.
*/
GLOBAL_FUNCTION mpc55xx_get_system_clock
#if ((MPC55XX_CHIP_TYPE >= 5510) && (MPC55XX_CHIP_TYPE <= 5517))
#if FMPLL_HAS_ENHANCED_FMPLL
LA r4, FMPLL_ESYNCR1
lwz r3, 0(r4)
/* EPREDIV */
@@ -152,8 +158,7 @@ GLOBAL_FUNCTION mpc55xx_get_system_clock
divw r3, r8, r5 /* REF_CLOCK/PREDIV */
mullw r3, r6, r3 /* REF_CLOCK/PREDIV*MFD */
divw r3, r3, r7 /* REF_CLOCK/PREDIV*MFD/RFD */
#else
#else /* !FMPLL_HAS_ENHANCED_FMPLL */
LA r4, FMPLL_SYNCR
lwz r3, 0(r4)
@@ -172,7 +177,7 @@ GLOBAL_FUNCTION mpc55xx_get_system_clock
mullw r6, r6, r8
sraw r6, r6, r7
divw r3, r6, r5
#endif
#endif /* !FMPLL_HAS_ENHANCED_FMPLL */
blr
+28
View File
@@ -278,10 +278,38 @@ $(PROJECT_INCLUDE)/mpc55xx/siu.h: mpc55xx/include/siu.h $(PROJECT_INCLUDE)/mpc55
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/siu.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/siu.h
$(PROJECT_INCLUDE)/mpc55xx/irq.h: mpc55xx/include/irq.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/irq.h
$(PROJECT_INCLUDE)/mpc55xx/watchdog.h: mpc55xx/include/watchdog.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/watchdog.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/watchdog.h
$(PROJECT_INCLUDE)/mpc55xx/fsl-mpc551x.h: mpc55xx/include/fsl-mpc551x.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc551x.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc551x.h
$(PROJECT_INCLUDE)/mpc55xx/fsl-mpc555x.h: mpc55xx/include/fsl-mpc555x.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc555x.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc555x.h
$(PROJECT_INCLUDE)/mpc55xx/fsl-mpc556x.h: mpc55xx/include/fsl-mpc556x.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc556x.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc556x.h
$(PROJECT_INCLUDE)/mpc55xx/fsl-mpc567x.h: mpc55xx/include/fsl-mpc567x.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc567x.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/fsl-mpc567x.h
$(PROJECT_INCLUDE)/mpc55xx/regs-edma.h: mpc55xx/include/regs-edma.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/regs-edma.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/regs-edma.h
$(PROJECT_INCLUDE)/mpc55xx/regs-mmu.h: mpc55xx/include/regs-mmu.h $(PROJECT_INCLUDE)/mpc55xx/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc55xx/regs-mmu.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc55xx/regs-mmu.h
$(PROJECT_INCLUDE)/bsp/irq.h: mpc55xx/include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h