RPI2

The boot partition must contain the following files, get them from one of the official images:(bootable/fat32 partition)

  • bootcode.bin : 2nd stage bootloader, starts with SDRAM disabled
  • loader.bin : 3rd stage bootloader, starts with SDRAM enabled
  • start.elf: The GPU binary firmware image, provided by the foundation.
  • kernel.img: The OS kernel to load on the ARM processor. Normally this is Linux - see instructions for compiling a kernel.
  • cmdline.txt: Parameters passed to the kernel on boot.


Optional files:

  • config.txt: A configuration file read by the GPU. Use this to override set the video mode, alter system clock speeds, voltages, etc.
  • vlls directory: Additional GPU code, e.g. extra codecs. Not present in the initial release.


jiffies

The kernel keeps track of the flow of time by means of timer interrupts. Every time a timer interrupt occurs, the value of an internal kernel counter, jiffies, is incremented.

The macro HZ defines the number of jiffies in one second

File: /arch/arm/include/asm/param.h

# define HZ     CONFIG_HZ   /* Internal kernel timer frequency */
File: .config
// default in Raspian
CONFIG_HZ=100



GPIO 控制

PWR 通过GPIO 35 (BCM mode)控制

ACT通过 GPIO 47 (BCM mode)控制


但是这两个GPIO并没有PIN header,貌似也不能通过写/sys/class/gpio/export的方式导出到用户空间。

要写这两个GPIO需要通过访问GPIO控制寄存器来实现:

1) GPIO控制寄存器的地址:
     
     #define GPIO_BASE                (BCM2708_PERI_BASE + 0x200000) /* GPIO */     
     $KERNEL/arch/arm/mach-bcm2709/include/mach/platform.h


2) 要访问这个地址可以通过/dev/mem 来实现(mmap, 需要root权限)


你可能感兴趣的:(RPI2)