📄 platform.c
字号:
/* * File: pb1000/platform.c * * Purpose: Platform glue code * * Notes: * * Author: Eric DeVolder * Date: Jan-7-2002 * * Modifications: * */#include "example.h"/********************************************************************/// Boot Image Locations //staticconst char *const flashAddresses[] = { "BE000000", 0};staticconst char *const fileNames[] = { "pb1000.bin", "pb1000.elf", "nk.bin", "vmlinux.elf", "vmlinux.rec", 0};staticconst void *const jumpAddress = 0x0;/********************************************************************/void platformInit(void){#define static_config3 (*(volatile long *)0xb4001030)#define static_timing3 (*(volatile long *)0xb4001034)#define static_address3 (*(volatile long *)0xb4001038) /* YAMON didn't do this... */ static_config3 = 0x00000002; // type = PCMCIA static_timing3 = 0x280e3a07; // 40 cycle strobe, 7 cycle setup static_address3 = 0x10000000; // any PCMCIA select DPRINTF("Pb1000 platformInit() \n"); /* pin_func: guarantee GPIO6 as GPIO */ wrReg(0xB190002C, 0);}/********************************************************************/void au1_sleep(void){ /* FIX!!! This is incomplete, as the SDRAM should be put to Sleep */ /* * Setup GPIO6 (pushbutton S8 on Pb1000) */ /* pin_func: guarantee GPIO6 as GPIO */ wrReg(0xB190002C, 0); /* Enable GPIO6 as input */ wrReg(0xb1900110, 0); /* wakeup_source: Allow GPIO6 to cause wakeup */ wrReg(0xB1900034, 0x0040); /* wakeup_cause: clear it */ wrReg(0xB190005C, ~0); /* * Prepare power supply for Sleep */ wrReg(0xB1900078, 0); /* * Put Au1000 into Sleep */ wrReg(0xB190007C, 0);}/********************************************************************/intplatformGetBootData(const char *const **files, const char *const **addresses, const void **jump){ *files = fileNames; *addresses = flashAddresses; *jump = jumpAddress; return 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -