📄 inithw_a9.c
字号:
/*=============================================================================*/
/* TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION */
/* */
/* Property of Texas Instruments */
/* For Unrestricted Internal Use Only */
/* Unauthorized reproduction and/or distribution is strictly prohibited. */
/* This product is protected under copyright law and trade secret law */
/* as an unpublished work. */
/* Created 2001, (C) Copyright 2001 Texas Instruments. All rights reserved. */
/* */
/* Filename : InitHW_a9.c */
/* */
/* Description : Functions for the initialization of ARM9 and DSP */
/* */
/* Project : OMAP3 - HELEN */
/* */
/* Author : Arnaud Balmelle a-balmelle@ti.com */
/* */
/*=============================================================================*/
#include "omap30.h"
#include "omap1510.h"
#include "InitHW_a9.h"
extern unsigned long add;
void InitDSPMMU( void );
void InitLCD_STN12BPP( void );
/*----------------------------------------------------------*/
/* NAME : InitDSPMMU */
/* DESCRIPTION : Initialization of the DSP MMU */
/* */
/* PARAMETERS : None */
/* RETURN VALUE: None */
/* LIMITATIONS : None */
/*----------------------------------------------------------*/
void InitDSPMMU( void )
{
/* ---------------------------------------------------------------------
Build Translation table and enable DSP MMU
Virtual Address (DSP Memory Space)| Physical Address (ARM Memory Space)
========================================================================
org = 0x00400000 len = 0x100000 | org = 0x00000000 len = 0x100000
org = 0x00500000 len = 0x100000 | org = 0x10000000 len = 0x100000
org = 0x00600000 len = 0x100000 | org = 0x20000000 len = 0x100000
---------------------------------------------------------------------- */
/* Release reset and enable the DSP MMU */
MMU_Release_Reset(DSP_MMU);
MMU_Enable(DSP_MMU);
MMU_Write_TLB_Entry(DSP_MMU,
0x10200000, /* Physical address */
0x00080000, /* Virtual address */
LARGE_PAGE, //Size: 64K /* Size : 1 MBytes */
FULL_ACCESS, /* Ap bits */
0, /* Locked base value */
0, /* 1st entry */
ENTRY_NOT_PRESERVED);
/* Second entry of TLB (Translation Lockaside Buffer) */
MMU_Write_TLB_Entry(DSP_MMU,
0x10300000, /* Physical address */
0x00400000, /* Virtual address */
SECTION, /* Size : 1 MBytes */
FULL_ACCESS, /* Ap bits */
0, /* Locked base value */
1, /* 2nd entry */
ENTRY_NOT_PRESERVED);
/* Second entry of TLB (Translation Lockaside Buffer) */
MMU_Write_TLB_Entry(DSP_MMU,
0x10600000, /* Physical address */
0x00500000, /* Virtual address */
SECTION, /* Size : 1 MBytes */
FULL_ACCESS, /* Ap bits */
0, /* Locked base value */
2, /* 2nd entry */
ENTRY_NOT_PRESERVED);
}
///////////////////////////////////////////////////////////
void InitLCD_STN12BPP( void )
{
// Change LCD Clock divider and Enable LCD Clock
// CLKRST_SetClockDivider(LCD_DIV,CLK_DIV_BY_2);
CLKRST_SetPeripheralClockEnable(LCD_CK, ENABLE);
CLKRST_SetPeripheralClockEnable(DMA_REQ_CK, DISABLE);
// Initialization of LCD Channel of System DMA
DMA_SetupSystemDma(DMA_FREE_RUNNING);
*((unsigned short*)0xFFFEDB00) = 0x0000;
*((unsigned short*)0xFFFEDB02) = 0x0000;
*((unsigned short*)0xFFFEDB04) = 0x1030;
*((unsigned short*)0xFFFEDB06) = 0x581E;
*((unsigned short*)0xFFFEDB08) = 0x1032;
// Initialization of LCD Controller
LCD_ControllerDisable();
LCD_SetLcdTiming0Register((240-1), // PixelPerLine
8, // HorizontalSynchroPulseWidth
2, // HorizontalFrontPorsh
1); // HorizontalBackPorsh
LCD_SetLcdTiming1Register((320-1), // LinePerPanel
9, // VerticalSynchroPulseWidth
4,//0, // VerticalFrontPorsh
9);//0); // VerticalBackPorsh
LCD_SetLcdTiming2Register(8, // PixelClockDivisor
0, // AcPinFrequency
0, // AcBiasPinTransitionPerInterrupt
1,//TRUE, // InvertVsync
1,//TRUE, // InvertHsync
0,//FALSE, // InvertPixelClock
0);//FALSE); // InvertOutputEnable
LCD_SetControlRegister(LCD_Disable,
LCD_Color,
LCD_FrameInterruptDisable,
LCD_LoadInterruptDisable,
LCD_Tft,
LCD_LittleEndian,
LCD_4bit,
0, // FifoDmaRequestDelay
//LCD_DataLoading,
LCD_PaletteDataLoading,
LCD_WinCEDisable);
memset((int*)0x10300000, 0, 32);
*((unsigned short*)0x10300000) = 0x4000;
LCD_ControllerEnable();
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -