• Пожаловаться

Christopher Hallinan: Embedded Linux Primer: A Practical, Real-World Approach

Здесь есть возможность читать онлайн «Christopher Hallinan: Embedded Linux Primer: A Practical, Real-World Approach» весь текст электронной книги совершенно бесплатно (целиком полную версию). В некоторых случаях присутствует краткое содержание. год выпуска: 2006, ISBN: 978-0-13-167984-9, издательство: Prentice Hall, категория: ОС и Сети / на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале. Библиотека «Либ Кат» — LibCat.ru создана для любителей полистать хорошую книжку и предлагает широкий выбор жанров:

любовные романы фантастика и фэнтези приключения детективы и триллеры эротика документальные научные юмористические анекдоты о бизнесе проза детские сказки о религиии новинки православные старинные про компьютеры программирование на английском домоводство поэзия

Выбрав категорию по душе Вы сможете найти действительно стоящие книги и насладиться погружением в мир воображения, прочувствовать переживания героев или узнать для себя что-то новое, совершить внутреннее открытие. Подробная информация для ознакомления по текущему запросу представлена ниже:

libcat.ru: книга без обложки
  • Название:
    Embedded Linux Primer: A Practical, Real-World Approach
  • Автор:
  • Издательство:
    Prentice Hall
  • Жанр:
  • Год:
    2006
  • Язык:
    Английский
  • ISBN:
    978-0-13-167984-9
  • Рейтинг книги:
    4 / 5
  • Избранное:
    Добавить книгу в избранное
  • Ваша оценка:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Embedded Linux Primer: A Practical, Real-World Approach: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Embedded Linux Primer: A Practical, Real-World Approach»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Comprehensive Real-World Guidance for Every Embedded Developer and Engineer This book brings together indispensable knowledge for building efficient, high-value, Linux-based embedded products: information that has never been assembled in one place before. Drawing on years of experience as an embedded Linux consultant and field application engineer, Christopher Hallinan offers solutions for the specific technical issues you're most likely to face, demonstrates how to build an effective embedded Linux environment, and shows how to use it as productively as possible. Hallinan begins by touring a typical Linux-based embedded system, introducing key concepts and components, and calling attention to differences between Linux and traditional embedded environments. Writing from the embedded developer's viewpoint, he thoroughly addresses issues ranging from kernel building and initialization to bootloaders, device drivers to file systems. Hallinan thoroughly covers the increasingly popular BusyBox utilities; presents a step-by-step walkthrough of porting Linux to custom boards; and introduces real-time configuration via CONFIG_RT--one of today's most exciting developments in embedded Linux. You'll find especially detailed coverage of using development tools to analyze and debug embedded systems--including the art of kernel debugging. • Compare leading embedded Linux processors • Understand the details of the Linux kernel initialization process • Learn about the special role of bootloaders in embedded Linux systems, with specific emphasis on U-Boot • Use embedded Linux file systems, including JFFS2--with detailed guidelines for building Flash-resident file system images • Understand the Memory Technology Devices subsystem for flash (and other) memory devices • Master gdb, KGDB, and hardware JTAG debugging • Learn many tips and techniques for debugging within the Linux kernel • Maximize your productivity in cross-development environments • Prepare your entire development environment, including TFTP, DHCP, and NFS target servers • Configure, build, and initialize BusyBox to support your unique requirements

Christopher Hallinan: другие книги автора


Кто написал Embedded Linux Primer: A Practical, Real-World Approach? Узнайте фамилию, как зовут автора книги и список всех его произведений по сериям.

Embedded Linux Primer: A Practical, Real-World Approach — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Embedded Linux Primer: A Practical, Real-World Approach», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема

Шрифт:

Сбросить

Интервал:

Закладка:

Сделать

Here we examine how the SDRAM controller is configured on the 405GP processor as configured by the U-Boot bootloader we covered in Chapter 7, "Bootloaders." Recall from Chapter 7 that U-Boot provides a hook for SDRAM initialization from the assembly language startup code found in start.S in the 4xx-specific cpu directory. Refer back to Section 7.4.4 "Board-Specific Initialization" in Chapter 7. Listing D-1 reproduces the sdram_init() function from U-Boot's .../cpu/ppc4xx/sdram.c file.

Listing D. ppc4xx sdram_init() from U-Boot

01 void sdram_init(void)

02{

03ulong sdtr1;

04ulong rtr;

05int i;

06

07/*

08* Support for 100MHz and 133MHz SDRAM

09*/

10if (get_bus_freq(0) > 100000000) {

11/*

12* 133 MHz SDRAM

13*/

14sdtr1 = 0x01074015;

15rtr = 0x07f00000;

16} else {

17/*

18* default: 100 MHz SDRAM

19*/

20sdtr1 = 0x0086400d;

21rtr = 0x05f00000;

22}

23

24for (i=0; i

25/*

26* Disable memory controller.

27*/

28mtsdram0(mem_mcopt1, 0x00000000);

29

30/*

31* Set MB0CF for bank 0.

32*/

33mtsdram0(mem_mb0cf, mb0cf[i].reg);

34mtsdram0(mem_sdtr1, sdtr1);

35mtsdram0(mem_rtr, rtr);

36

37udelay(200);

38

39/*

40* Set memory controller options reg, MCOPT1.

41* Set DC_EN to '1' and BRD_PRF to '01' for 16 byte PLB Burst

42* read/prefetch.

43*/

44mtsdram0(mem_mcopt1, 0x80800000);

45

46udelay(10000);

47

48if (get_ram_size(0, mb0cf[i].size) == mb0cf[i].size) {

49/*

50* OK, size detected -> all done

51*/

52return;

53}

54}

55}

The first action reads the pin strapping on the 405GP processor to determine the design value for the SDRAM clock. In this case, we can see that two possible values are accommodated: 100MHz and 133MHz. Based on this choice, constants are chosen that will be used later in the function to set the appropriate register bits in the SDRAM controller.

Starting on line 24, a loop is used to set the parameters for each of up to five predefined memory sizes. Currently, U-Boot has logic to support a single bank of memory sized at 4MB, 16MB, 32MB, 64MB, or 128MB. These sizes are defined in a table called mb0cf in .../cpu/ppc4xx/sdram.c. The table associates a constant with each of these memory sizes, based on the value required in the 405GP memory bank configuration register. The loop does this:

for (i = each possible memory bank size, largest first) {

select timing constant based on SDRAM clock speed;

disable SDRAM memory controller;

configure bank 0 with size[i], timing constants[i];

re-enable SDRAM memory controller;

run simple memory test to dynamically determine size;

/* This is done using get_ram_size() */

if (tested size == configured size) done;

}

This simple logic simply plugs in the correct timing constants in the SDRAM controller based on SDRAM clock speed and configured memory bank size from the hard-coded table in U-Boot. Using this explanation, you can easily correlate the bank configuration values using the 405GP reference manual. For a 64MB DRAM size, the memory bank control register is set as follows:

Memory Bank 0 Control Register = 0x000a4001

The PowerPC 405GP User's Manual describes the fields in Table D-2 for the memory bank 0 control register.

Table D-2. 405GP Memory Bank 0-3 Configuration Register Fields

FieldValueComments
Bank Address (BA)0x00Starting memory address of this bank.
Size (SZ)0x4Size of this memory bankin this case, 64MB.
Addressing Mode (AM)0x2Determines the organization of memory, including the number of row and column bits. In this case, Mode 2 = 12 row address bits, and either 9 or 10 column address bits, and up to four internal SDRAM banks. This data is provided in a table in the 405GP user's manual.
Bank Enable (BE)0x1Enable bit for the bank configured by this register. There are four of these memory bank configuration registers in the 405GP.

The values in this table must be determined by the designer, based on the choice of memory module in use on the board.

Let's look at a timing example for more detail on the timing requirements of a typical SDRAM controller. Assuming a 100MHz SDRAM clock speed and 64MB memory size, the timing constants selected by the sdram_init() function in Listing D-1 are selected as follows:

SDRAM Timing Register = 0x0086400d

Refresh Timing Register = 0x05f00000

The PowerPC 405GP User's Manual describes the fields in Table D-3 for the SDRAM Timing Register.

Table D-3. 405GP SDRAM Timing Register Fields

FieldValueComments
CAS Latency (CASL)0x1SDRAM CAS Latency. This value comes directly from the SDRAM chip specifications. It is the delay in clock cycles required by the chip between issuance of the read command (CAS signal) until the data is available on the data bus. In this case, the 0x1 represents two clock cycles, as seen from the 405GP user's manual.
Precharge Command to Next Activate (PTA)0x1The SDRAM Precharge command deactivates a given row. In contrast, the Activate command enables a given row for subsequent access, such as during a burst cycle. This timing parameter enforces the minimum time between Precharge to a subsequent Activate cycle and is dictated by the SDRAM chip. The correct value must be obtained from the SDRAM chip specification. In this case, 0x1 represents two clock cycles, as determined from the 405GP user's manual.
Read/Write to Precharge Command Minimum (CTP)0x2This timing parameter enforces the minimum time delay between a given SDRAM read or write command to a subsequent Precharge command. The correct value must be obtained from the SDRAM chip specification. In this case, 0x2 represents three clock cycles, as determined from the 405GP user's manual.
SDRAM Command Leadoff (LDF)0x1This timing parameter enforces the minimum time delay between assertion of address or command cycle to bank select cycle. The correct value must be obtained from the SDRAM chip specification. In this case, 0x1 represents two clock cycles, as determined from the 405GP user's manual.

The final timing parameter configured by the U-Boot example in Listing D-1 is the refresh timing register value. This register requires a single field that determines the refresh interval enforced by the SDRAM controller. The field representing the interval is treated as a simple counter running at the SDRAM clock frequency. In the example here, we assumed 100MHz as the SDRAM clock frequency. The value programmed into this register in our example is 0x05f0_0000. From the PowerPC 405GP User's Manual, we determine that this will produce a refresh request every 15.2 microseconds. As with the other timing parameters, this value is dictated by the SDRAM chip specifications.

Читать дальше
Тёмная тема

Шрифт:

Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Embedded Linux Primer: A Practical, Real-World Approach»

Представляем Вашему вниманию похожие книги на «Embedded Linux Primer: A Practical, Real-World Approach» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё не прочитанные произведения.


Отзывы о книге «Embedded Linux Primer: A Practical, Real-World Approach»

Обсуждение, отзывы о книге «Embedded Linux Primer: A Practical, Real-World Approach» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.