Changeset 0fb70e1 in mainline


Ignore:
Timestamp:
2012-10-09T21:31:38Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
954b6458
Parents:
a829a5b
Message:

kernel drivers directory layout reorganization and UART improvements:

  • Put AM335x and AMDM37 specific code under the appropriate directories.

Beaglebone specific changes:

  • Initialize the UART0 when bbone_init() is called.
Files:
4 added
4 edited
6 moved

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    ra829a5b r0fb70e1  
    420420% Output device class
    421421@ "generic" Monitor or serial line
    422 ! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm)] CONFIG_HID_OUT (choice)
     422! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm|MACHINE=beaglebone)] CONFIG_HID_OUT (choice)
    423423
    424424% Output device class
     
    480480! [PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_IRQC (y)
    481481
    482 % Support for TI AMDM37X on-chip UART
     482% Support for TI AM335x on-chip UART
     483! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beaglebone] CONFIG_AM335X_UART (y/n)
     484
     485% Support for TI AMDM37x on-chip UART
    483486! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beagleboardxm] CONFIG_AMDM37X_UART (y/n)
    484487
     
    502505
    503506% Serial line input module
    504 ! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_AMDM37X_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
     507! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_AM335X_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_AMDM37X_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
    505508
    506509% EGA support
  • kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c

    ra829a5b r0fb70e1  
    3535#include <arch/exception.h>
    3636#include <arch/mach/beagleboardxm/beagleboardxm.h>
    37 #include <genarch/drivers/amdm37x_irc/amdm37x_irc.h>
    38 #include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
    39 #include <genarch/drivers/amdm37x_gpt/amdm37x_gpt.h>
    40 #include <genarch/drivers/amdm37x_dispc/amdm37x_dispc.h>
     37#include <genarch/drivers/amdm37x/uart.h>
     38#include <genarch/drivers/amdm37x/irc.h>
     39#include <genarch/drivers/amdm37x/gpt.h>
     40#include <genarch/drivers/amdm37x/dispc.h>
    4141#include <genarch/fb/fb.h>
    4242#include <genarch/srln/srln.h>
  • kernel/arch/arm32/src/mach/beaglebone/beaglebone.c

    ra829a5b r0fb70e1  
    3535#include <arch/exception.h>
    3636#include <arch/mach/beaglebone/beaglebone.h>
    37 #include <genarch/drivers/am335x_irc/am335x_irc.h>
     37#include <genarch/drivers/am335x/irc.h>
     38#include <genarch/drivers/am335x/uart.h>
     39#include <genarch/srln/srln.h>
    3840#include <interrupt.h>
    3941#include <ddi/ddi.h>
     
    5456static struct beaglebone {
    5557        am335x_irc_regs_t *irc_addr;
     58        am335x_uart_t uart;
    5659} bbone;
    5760
    5861struct arm_machine_ops bbone_machine_ops = {
    59         bbone_init,
    60         bbone_timer_irq_start,
    61         bbone_cpu_halt,
    62         bbone_get_memory_extents,
    63         bbone_irq_exception,
    64         bbone_frame_init,
    65         bbone_output_init,
    66         bbone_input_init,
    67         bbone_get_irq_count,
    68         bbone_get_platform_name
     62        .machine_init = bbone_init,
     63        .machine_timer_irq_start = bbone_timer_irq_start,
     64        .machine_cpu_halt = bbone_cpu_halt,
     65        .machine_get_memory_extents = bbone_get_memory_extents,
     66        .machine_irq_exception = bbone_irq_exception,
     67        .machine_frame_init = bbone_frame_init,
     68        .machine_output_init = bbone_output_init,
     69        .machine_input_init = bbone_input_init,
     70        .machine_get_irq_count = bbone_get_irq_count,
     71        .machine_get_platform_name = bbone_get_platform_name,
    6972};
    7073
     
    105108static void bbone_output_init(void)
    106109{
     110        const bool ok = am335x_uart_init(&bbone.uart,
     111            AM335x_UART0_IRQ, AM335x_UART0_BASE_ADDRESS,
     112            AM335x_UART0_SIZE);
     113
     114        if (ok)
     115                stdout_wire(&bbone.uart.outdev);
    107116}
    108117
    109118static void bbone_input_init(void)
    110119{
     120        srln_instance_t *srln_instance = srln_init();
     121        if (srln_instance) {
     122                indev_t *sink = stdin_wire();
     123                indev_t *srln = srln_wire(srln_instance, sink);
     124                am335x_uart_input_wire(&bbone.uart, srln);
     125                am335x_irc_enable(bbone.irc_addr, AM335x_UART0_IRQ);
     126        }
    111127}
    112128
    113129size_t bbone_get_irq_count(void)
    114130{
    115         return 0;
     131        return AM335x_IRC_IRQ_COUNT;
    116132}
    117133
  • kernel/genarch/Makefile.inc

    ra829a5b r0fb70e1  
    106106endif
    107107
     108ifeq ($(CONFIG_AM335X_UART),y)
     109        GENARCH_SOURCES += \
     110                genarch/src/drivers/am335x/uart.c
     111endif
     112
    108113ifeq ($(CONFIG_AMDM37X_UART),y)
    109114        GENARCH_SOURCES += \
    110                 genarch/src/drivers/amdm37x_uart/amdm37x_uart.c
     115                genarch/src/drivers/amdm37x/uart.c
    111116endif
    112117
  • kernel/genarch/include/drivers/amdm37x/uart_regs.h

    ra829a5b r0fb70e1  
    3131/**
    3232 * @file
    33  * @brief Texas Instruments AMDM37x on-chip interrupt controller driver.
     33 * @brief Texas Instruments AMDM37x UART memory mapped registers.
    3434 */
    3535
     
    4040#include <console/chardev.h>
    4141#include <ddi/irq.h>
    42 
    43 /* AMDM37x TRM p. 2950 */
    44 #define AMDM37x_UART1_BASE_ADDRESS   0x4806a000
    45 #define AMDM37x_UART1_SIZE   1024
    46 #define AMDM37x_UART1_IRQ   72 /* AMDM37x TRM p. 2418 */
    47 
    48 #define AMDM37x_UART2_BASE_ADDRESS   0x4806b000
    49 #define AMDM37x_UART2_SIZE   1024
    50 #define AMDM37x_UART2_IRQ   73 /* AMDM37x TRM p. 2418 */
    51 
    52 #define AMDM37x_UART3_BASE_ADDRESS   0x49020000
    53 #define AMDM37x_UART3_SIZE   1024
    54 #define AMDM37x_UART3_IRQ   74 /* AMDM37x TRM p. 2418 */
    55 
    56 #define AMDM37x_UART4_BASE_ADDRESS   0x49042000
    57 #define AMDM37x_UART4_SIZE   1024
    58 #define AMDM37x_UART4_IRQ   80 /* AMDM37x TRM p. 2418 */
    5942
    6043typedef struct {
     
    343326
    344327                /** BOF control register (IrDA only) */
    345                 ioport32_t blr; /* UART3 sepcific */
     328                ioport32_t blr; /* UART3 specific */
    346329#define AMDM37x_IRDA_BLR_XBOF_TYPE_FLAG   (1 << 6)
    347330#define AMDM37x_IRDA_BLR_STS_FIFO_RESET   (1 << 7)
     
    442425} amdm37x_uart_regs_t;
    443426
    444 typedef struct {
    445         amdm37x_uart_regs_t *regs;
    446         indev_t *indev;
    447         outdev_t outdev;
    448         irq_t irq;
    449 } amdm37x_uart_t;
    450 
    451 
    452 bool amdm37x_uart_init(amdm37x_uart_t *, inr_t, uintptr_t, size_t);
    453 void amdm37x_uart_input_wire(amdm37x_uart_t *, indev_t *);
    454 
    455427#endif
    456428
  • kernel/genarch/src/drivers/amdm37x/uart.c

    ra829a5b r0fb70e1  
    3434 */
    3535
    36 #include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
     36#include <genarch/drivers/amdm37x/uart.h>
    3737#include <ddi/device.h>
    3838#include <str.h>
Note: See TracChangeset for help on using the changeset viewer.