Low-Level Hardware

From IPhone Linux

Jump to: navigation, search

These tasks will will allow us to have a platform from which we can perform future development. With the exception of USB support, all of the devices here are critically important for anything to work. USB is a priority and placed here because many developers do not have access to a serial cable.

Contents

Bootstrapping (Done)

OpenIBoot needs to relocate itself to the right area of memory and setup stacks for all of its execution contexts. Basically, we need to be able to reliably execute whatever code we want.

Processor setup (Done)

OpenIBoot needs to initialize the processor to an appropriate state for launching an operating system. No undue assumptions can be made about the state of the CPU configuration registers because we need to do the same initialization iBoot needs to take care of.

Clock (Done)

OpenIBoot needs to start the clock on the system controller. This is needed for every other piece of hardware on the device: they all need a proper clock signal.

Timer (Done)

The timer device is important to provide basic udelay and usleep functionality, as well as future task-switching capabilities

Status

All the timer routines have been coded. udelay() and thus the RTC seems to work, but the periodic timer interrupt did not seem to in the past. This may be due to the earlier layout bug that gave incorrect register addresses to OpenIBoot. Fixed. Timer and event code is now fully functional.

Tasks

  • Verify timer code: Someone needs to make sure that the timer code is working now and fix it if not. (Assigned to: planetbeing)

Serial (Partially done)

We need to have some sort of I/O with OpenIBoot so debugging is not extremely painful.

Status

Serial UART has been proven to be able to transmit in polling mode in one test case. This proves our code works. There has been a subsequent major refactoring, but we should be able to fix it if it turned out the refactoring broke it.

Tasks

  • Verify transmit works after refactoring (Assigned to: planetbeing)
  • Verify receive works (Assigned to: No one)
  • Add interrupt support: We will need to do asynchronous debugging eventually, and this will be necessary. (Assigned to: No one)

Library Functions (Done)

Since we don't have access to a working operating system within our code, or libc, we will have to write some necessary routines.

Status

Most of the routines are either trivial to write or have already been written. However, malloc still needs to be written and the implementation of that requires some thought. Doug Lea's public domain malloc has been installed without much trouble. To support it, a very simple sbrk was written (since everything is in the same address space).

Tasks

  • Write heap management and malloc()/free(): (Assigned to: planetbeing)

USB Support (Done)

This will be another form of debugging I/O. It is necessary because many people do not have access to serial cables and it would be nice if there were less barriers to entry for developers.

Status

USB routines have been written. The code is very buggy and seems to be subject to some race conditions, but still, it can enumerate and do some tx/rx. A couple more days of bug hunting ought to do the trick. Additional code for a very similar USB device can be found in the Linux source code published by Samsung for smdk6400.

Tasks

  • Write USB internal data structures init: We need to design what internal data structures we will use for managing USB endpoints and devices. We also need to initialize the USB specification data structures we will send during configuration. (Assigned to: planetbeing)
  • Finish USB hardware init: We need to figure out the rest of what is necessary to finish initialization of the USB hardware. Probably not too hard. (Assigned to: planetbeing)
  • Write USB interrupt handler: This routine should handle USB configuration and should multiplex the received data among the endpoints. (Assigned to: planetbeing)
  • Write endpoint write routines: These will be used to transmit data on individual endpoints. (Assigned to: planetbeing)
  • Test and debug USB driver: (Assigned to: planetbeing)
  • Fix stability issues: (Assigned to: planetbeing)
Personal tools
Toolbox
thanks to the guys at
  ModMyiFone.com and
  NegriElectronics for the
  test iPod Touch!