RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Modules | Files | Data Structures | Macros | Typedefs | Functions | Variables
LEON3 and LEON4

LEON3 and LEON4 Board Support Package. More...

Modules

 GR740 Bootstrap Signals
 This group contains the GR740 Bootstrap Signals interfaces.
 
 GR740 I/0 and PLL Configuration
 This group contains the GR740 I/0 and PLL Configuration interfaces.
 
 GR740 Temperatur Sensor Controller
 This group contains the GR740 Temperatur Sensor Controller interfaces.
 
 LEON3 AMBA Driver Handler
 AMBA Plag & Play Bus Driver Macros.
 

Files

file  gr_leon4_n2x.h
 This header file provides interfaces of the GR-CPCI-LEON4-N2X (NGFP) PCI Peripheral driver.
 
file  ckinit.c
 This source file contains the Clock Driver implementation.
 
file  printk_support.c
 This source file contains the definition of BSP_output_char and BSP_poll_char.
 
file  gnatsupp.c
 Support for gnat/rtems interrupts and exception handling.
 
file  bsp.h
 Global BSP definitions.
 
file  irq.h
 LEON3 generic shared IRQ setup.
 
file  irqimpl.h
 This header file provides interfaces used by the interrupt support implementation.
 
file  leon3.h
 This header file provides interfaces used by the BSP implementation.
 
file  leon.h
 LEON3 BSP data types and macros.
 
file  tm27.h
 Implementations for interrupt mechanisms for Time Test 27.
 
file  bspsmp.c
 LEON3 SMP BSP Support.
 
file  bspstart.c
 This source file contains the implementation of bsp_start() and definitions of BSP-specific objects.
 
file  cache.c
 This source file contains the implementation of the Cache Manager.
 
file  cpucounter.c
 This source file contains the implementation of the CPU Counter.
 
file  eirq.c
 This source file contains the implementation of the interrupt controller support.
 
file  gettargethash.c
 This source file contains the sparc/leon3 implementation of rtems_get_target_hash().
 
file  setvec.c
 Install an interrupt vector on SPARC.
 
file  bsp_isr_handler.c
 This source file contains the implementation of _SPARC_Interrupt_dispatch().
 

Data Structures

struct  leon3_timecounter
 Represents the LEON3-specific timecounter. More...
 

Macros

#define LEON3   1
 
#define BSP_FEATURE_IRQ_EXTENSION
 
#define BSP_IDLE_TASK_BODY   bsp_idle_thread
 
#define BSP_NUMBER_OF_TERMIOS_PORTS   8
 
#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH   "open_eth1"
 
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH    rtems_leon_open_eth_driver_attach
 
#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111   "smc_eth1"
 
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111    rtems_smc91111_driver_attach_leon3
 
#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH   "gr_eth1"
 
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH    rtems_leon_greth_driver_attach
 
#define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH
 
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH   RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH
 
#define HAS_SMC91111
 
#define GRETH_SUPPORTED
 
#define GRETH_MEM_LOAD(addr)   leon_r32_no_cache((uintptr_t)addr)
 
#define AMBAPPBUS_INFO_AVAIL   /* AMBAPP Bus driver */
 
#define APBUART_INFO_AVAIL   /* APBUART Console driver */
 
#define GPTIMER_INFO_AVAIL   /* GPTIMER Timer driver */
 
#define GRETH_INFO_AVAIL   /* GRETH Ethernet driver */
 
#define LEON3_IRQCTRL_ACQUIRE(_lock_context)    rtems_interrupt_lock_acquire( &LEON3_IrqCtrl_Lock, _lock_context )
 Acquires the interrupt controller lock.
 
#define LEON3_IRQCTRL_RELEASE(_lock_context)    rtems_interrupt_lock_release( &LEON3_IrqCtrl_Lock, _lock_context )
 Releases the interrupt controller lock.
 
#define LEON3_REG_CACHE_CTRL_FI   0x00200000U
 This constant represents the flush instruction cache flag of the LEON cache control register.
 
#define LEON3_REG_CACHE_CTRL_DS   0x00800000U
 This constant represents the data cache snooping enable flag of the LEON cache control register.
 
#define LEON3_CLOCK_INDEX   0
 This constant defines the index of the GPTIMER timer used by the clock driver.
 
#define LEON3_COUNTER_GPTIMER_INDEX   ( LEON3_CLOCK_INDEX + 1 )
 This constant defines the index of the GPTIMER timer used by the CPU counter if the CPU counter uses the GPTIMER.
 
#define LEON3_GPTIMER_0_FREQUENCY_SET_BY_BOOT_LOADER   1000000
 This constant defines the frequency set by the boot loader of the first GPTIMER instance.
 

Typedefs

typedef void(* bsp_shared_isr) (void *arg)
 

Functions

void * bsp_idle_thread (uintptr_t ignored)
 Optimized idle task.
 
int rtems_leon_open_eth_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
 
int rtems_smc91111_driver_attach_leon3 (struct rtems_bsdnet_ifconfig *config, int attach)
 
int rtems_leon_greth_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
 
rtems_isr_entry set_vector (rtems_isr_entry handler, rtems_vector_number vector, int type)
 Install an interrupt handler.
 
void BSP_fatal_exit (uint32_t error)
 
void rtems_bsp_delay (int usecs)
 
void leon3_ext_irq_init (irqamp *regs)
 Initializes the interrupt controller for the boot processor.
 
RTEMS_NO_RETURN void leon3_power_down_loop (void)
 Sets asr19 to zero to enter the power-down mode of the processor in an infinite loop.
 

Variables

int CPU_SPARC_HAS_SNOOPING
 
int RAM_START
 
int RAM_END
 
int RAM_SIZE
 
int PROM_START
 
int PROM_END
 
int PROM_SIZE
 
int CLOCK_SPEED
 
int end
 
uint32_t LEON3_Cpu_Index
 This object provides the index of the boot processor.
 
rtems_interrupt_lock LEON3_IrqCtrl_Lock
 This lock serializes the interrupt controller access.
 
irqampLEON3_IrqCtrl_Regs
 This pointer provides the IRQ(A)MP register block address.
 
struct ambapp_devLEON3_IrqCtrl_Adev
 This pointer provides the IRQ(A)MP device information block.
 
uint32_t LEON3_IrqCtrl_EIrq
 This object provides the interrupt number used to multiplex extended interrupts or is zero if no extended interrupts are available.
 
int leon3_timer_core_index
 This object lets the user override which on-chip GPTIMER core will be used for system clock timer.
 
unsigned int leon3_timer_prescaler
 This object lets the user override system clock timer prescaler.
 
gptimerLEON3_Timer_Regs
 This pointer provides the GPTIMER register block address.
 
struct ambapp_devLEON3_Timer_Adev
 This pointer provides the GPTIMER device information block.
 
apbuartleon3_debug_uart
 This pointer provides the debug APBUART register block address.
 
leon3_timecounter leon3_timecounter_instance
 Provides the LEON3-specific timecounter.
 

Detailed Description

LEON3 and LEON4 Board Support Package.

Macro Definition Documentation

◆ LEON3_GPTIMER_0_FREQUENCY_SET_BY_BOOT_LOADER

#define LEON3_GPTIMER_0_FREQUENCY_SET_BY_BOOT_LOADER   1000000

This constant defines the frequency set by the boot loader of the first GPTIMER instance.

We assume that a boot loader (usually GRMON) initialized the GPTIMER 0 to run with 1MHz. This is used to determine all clock frequencies of the PnP devices. See also ambapp_freq_init() and ambapp_freq_get().

◆ LEON3_IRQCTRL_ACQUIRE

#define LEON3_IRQCTRL_ACQUIRE (   _lock_context)     rtems_interrupt_lock_acquire( &LEON3_IrqCtrl_Lock, _lock_context )

Acquires the interrupt controller lock.

Parameters
[out]_lock_contextis the lock context.

◆ LEON3_IRQCTRL_RELEASE

#define LEON3_IRQCTRL_RELEASE (   _lock_context)     rtems_interrupt_lock_release( &LEON3_IrqCtrl_Lock, _lock_context )

Releases the interrupt controller lock.

Parameters
[in,out]_lock_contextis the lock context.

Function Documentation

◆ bsp_idle_thread()

void * bsp_idle_thread ( uintptr_t  ignored)

Optimized idle task.

This BSP provides its own IDLE thread to override the RTEMS one.

This idle task sets the power mode to idle. This causes the processor clock to be stopped, while on-chip peripherals remain active. Any enabled interrupt from a peripheral or an external interrupt source will cause the processor to resume execution.

To enable the idle task use the following in the system configuration:

#include <bsp.h>
#define CONFIGURE_INIT
#define CONFIGURE_IDLE_TASK_BODY bsp_idle_thread
#include <confdefs.h>
This header file evaluates the application configuration options defined by the application.

This BSP provides its own IDLE thread to override the RTEMS one.

Optimized idle task.

The MSR[POW] bit is set to put the CPU into the low power mode defined in HID0. HID0 is set during starup in start.S.

This BSP provides its own IDLE thread to override the RTEMS one.

This idle task sets the power mode to idle. This causes the processor clock to be stopped, while on-chip peripherals remain active. Any enabled interrupt from a peripheral or an external interrupt source will cause the processor to resume execution.

To enable the idle task use the following in the system configuration:

#include <bsp.h>
#define CONFIGURE_INIT
#define CONFIGURE_IDLE_TASK_BODY bsp_idle_thread
#include <confdefs.h>

Optimized idle task.

The MSR[POW] bit is set to put the CPU into the low power mode defined in HID0. HID0 is set during starup in start.S.

◆ leon3_ext_irq_init()

void leon3_ext_irq_init ( irqamp regs)

Initializes the interrupt controller for the boot processor.

Parameters
[in,out]regsis the IRQ(A)MP register block address.

◆ set_vector()

rtems_isr_entry set_vector ( rtems_isr_entry  handler,
rtems_vector_number  vector,
int  type 
)

Install an interrupt handler.

This method installs an interrupt handle.

Parameters
[in]handleris the isr routine
[in]vectoris the vector number
[in]typeindicates whether RTEMS or RAW intr
Returns
returns old vector

Variable Documentation

◆ LEON3_Cpu_Index

uint32_t LEON3_Cpu_Index
extern

This object provides the index of the boot processor.

This object should be read-only after initialization.

◆ LEON3_IrqCtrl_EIrq

uint32_t LEON3_IrqCtrl_EIrq
extern

This object provides the interrupt number used to multiplex extended interrupts or is zero if no extended interrupts are available.

This object should be read-only after initialization.

◆ leon3_timecounter_instance

leon3_timecounter leon3_timecounter_instance
extern

Provides the LEON3-specific timecounter.

It is also used by the CPU counter implementation.

◆ leon3_timer_core_index

int leon3_timer_core_index
extern

This object lets the user override which on-chip GPTIMER core will be used for system clock timer.

This controls which timer core will be accociated with LEON3_Timer_Regs registers base address. This value will by destroyed during initialization.

  • 0 = Default configuration. GPTIMER[0]
  • 1 = GPTIMER[1]
  • 2 = GPTIMER[2]
  • ...

◆ leon3_timer_prescaler

unsigned int leon3_timer_prescaler
extern

This object lets the user override system clock timer prescaler.

This affects all timer instances on the system clock timer core determined by leon3_timer_core_index.

  • 0 = Default configuration. Use bootloader configured value.
  • N = Prescaler is set to N. N must not be less that number of timers.
  • 8 = Prescaler is set to 8 (the fastest prescaler possible on all HW)
  • ...