1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12#pragma once 13#include <autoconf.h> 14#include <platsupport/gen_config.h> 15 16/* Official device IDs, as recognized by ps_cdev_init(). 17 * 18 * The first 4 IDs, NV_UART[ABCD] are "real" devices, and the next 4 IDs, 19 * NV_UART[ABCD]_ASYNC are those same devices repeated. 20 * 21 * The difference is that if you request the first 4, you will get a handle to 22 * a ps_chardevice_t that exports a polling, synchronous interface. 23 * 24 * If you request the other 4, you will get a handle to a ps_chardevice_t that 25 * exports an irq-based, asynchronous interface (and requires you to handle 26 * IRQs and use callback functions). 27 */ 28enum chardev_id { 29 /* Synchronous devices. */ 30 NV_UARTA, 31 NV_UARTB, 32 NV_UARTC, 33 NV_UARTD, 34 /* Asynchronous versions of those devices. */ 35 NV_UARTA_ASYNC, 36 NV_UARTB_ASYNC, 37 NV_UARTC_ASYNC, 38 NV_UARTD_ASYNC, 39 /* Aliases */ 40 PS_SERIAL0 = NV_UARTA, 41 PS_SERIAL1 = NV_UARTB, 42 PS_SERIAL2 = NV_UARTC, 43 PS_SERIAL3 = NV_UARTD, 44}; 45