Mon Apr 17 20:41:55 2017 UTC ()
Add CAN registers


(bouyer)
diff -r1.90 -r1.90.2.1 src/sys/arch/arm/allwinner/awin_reg.h

cvs diff -r1.90 -r1.90.2.1 src/sys/arch/arm/allwinner/Attic/awin_reg.h (expand / switch to unified diff)

--- src/sys/arch/arm/allwinner/Attic/awin_reg.h 2016/12/26 16:20:17 1.90
+++ src/sys/arch/arm/allwinner/Attic/awin_reg.h 2017/04/17 20:41:55 1.90.2.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: awin_reg.h,v 1.90 2016/12/26 16:20:17 rjs Exp $ */ 1/* $NetBSD: awin_reg.h,v 1.90.2.1 2017/04/17 20:41:55 bouyer Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry. 8 * by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -3061,14 +3061,130 @@ struct awin_a31_dma_desc { @@ -3061,14 +3061,130 @@ struct awin_a31_dma_desc {
3061#define AWIN_LRADC_INT_KEYUP1 __BIT(12) 3061#define AWIN_LRADC_INT_KEYUP1 __BIT(12)
3062#define AWIN_LRADC_INT_ALREADYHOLD1 __BIT(11) 3062#define AWIN_LRADC_INT_ALREADYHOLD1 __BIT(11)
3063#define AWIN_LRADC_INT_HOLD1 __BIT(10) 3063#define AWIN_LRADC_INT_HOLD1 __BIT(10)
3064#define AWIN_LRADC_INT_KEY1 __BIT(9) 3064#define AWIN_LRADC_INT_KEY1 __BIT(9)
3065#define AWIN_LRADC_INT_DATA1 __BIT(8) 3065#define AWIN_LRADC_INT_DATA1 __BIT(8)
3066#define AWIN_LRADC_INT_KEYUP0 __BIT(4) 3066#define AWIN_LRADC_INT_KEYUP0 __BIT(4)
3067#define AWIN_LRADC_INT_ALREADYHOLD0 __BIT(3) 3067#define AWIN_LRADC_INT_ALREADYHOLD0 __BIT(3)
3068#define AWIN_LRADC_INT_HOLD0 __BIT(2) 3068#define AWIN_LRADC_INT_HOLD0 __BIT(2)
3069#define AWIN_LRADC_INT_KEY0 __BIT(1) 3069#define AWIN_LRADC_INT_KEY0 __BIT(1)
3070#define AWIN_LRADC_INT_DATA0 __BIT(0) 3070#define AWIN_LRADC_INT_DATA0 __BIT(0)
3071#define AWIN_LRADC_DATA0_REG 0x0c 3071#define AWIN_LRADC_DATA0_REG 0x0c
3072#define AWIN_LRADC_DATA1_REG 0x10 3072#define AWIN_LRADC_DATA1_REG 0x10
3073 3073
 3074/* CAN mode select register */
 3075#define AWIN_CAN_MODSEL_REG 0x00
 3076#define AWIN_CAN_MODSEL_SLEEP __BIT(4)
 3077#define AWIN_CAN_MODSEL_ACP_FLT_MOD __BIT(3)
 3078#define AWIN_CAN_MODSEL_LB_MOD __BIT(2)
 3079#define AWIN_CAN_MODSEL_LST_ONLY __BIT(1)
 3080#define AWIN_CAN_MODSEL_RST __BIT(0)
 3081
 3082/* CAN command register */
 3083#define AWIN_CAN_CMD_REG 0x04
 3084#define AWIN_CAN_CMD_BUS_OFF __BIT(5)
 3085#define AWIN_CAN_CMD_SELF_REQ __BIT(4)
 3086#define AWIN_CAN_CMD_CLR_OR __BIT(3)
 3087#define AWIN_CAN_CMD_REL_RX_BUF __BIT(2)
 3088#define AWIN_CAN_CMD_ABT_REQ __BIT(1)
 3089#define AWIN_CAN_CMD_TANS_REQ __BIT(0)
 3090
 3091/* CAN status register */
 3092#define AWIN_CAN_STA_REG 0x08
 3093#define AWIN_CAN_STA_ERR_CODE __BITS(23,22)
 3094#define AWIN_CAN_STA_ERR_CODE_BIT 0
 3095#define AWIN_CAN_STA_ERR_CODE_FORM 1
 3096#define AWIN_CAN_STA_ERR_CODE_STUFF 2
 3097#define AWIN_CAN_STA_ERR_CODE_OTHER 3
 3098#define AWIN_CAN_STA_ERR_DIR _BIT(21)
 3099#define AWIN_CAN_STA_ERR_SEG_CODE __BITS(20,16)
 3100#define AWIN_CAN_STA_ARB_LOST __BITS(12,8)
 3101#define AWIN_CAN_STA_BUS __BIT(7)
 3102#define AWIN_CAN_STA_ERR __BIT(6)
 3103#define AWIN_CAN_STA_TX __BIT(5)
 3104#define AWIN_CAN_STA_RX __BIT(4)
 3105#define AWIN_CAN_STA_TX_OVER __BIT(3)
 3106#define AWIN_CAN_STA_TX_RDY __BIT(2)
 3107#define AWIN_CAN_STA_DATA_OR __BIT(1)
 3108#define AWIN_CAN_STA_RX_RDY __BIT(0)
 3109
 3110/* CAN interrupt register */
 3111#define AWIN_CAN_INT_REG 0x0c
 3112#define AWIN_CAN_INT_BERR __BIT(7)
 3113#define AWIN_CAN_INT_ARB_LOST __BIT(6)
 3114#define AWIN_CAN_INT_ERR_PASSIVE __BIT(5)
 3115#define AWIN_CAN_INT_WAKEUP __BIT(4)
 3116#define AWIN_CAN_INT_DATA_OR __BIT(3)
 3117#define AWIN_CAN_INT_ERR __BIT(2)
 3118#define AWIN_CAN_INT_TX_FLAG __BIT(1)
 3119#define AWIN_CAN_INT_RX_FLAG __BIT(0)
 3120
 3121/* CAN interrupt enable register */
 3122#define AWIN_CAN_INTE_REG 0x10
 3123
 3124/* CAN bus timing register */
 3125#define AWIN_CAN_BUS_TIME_REG 0x14
 3126#define AWIN_CAN_BUS_TIME_SAM __BIT(23)
 3127#define AWIN_CAN_BUS_TIME_PHSEG2 __BITS(22,20)
 3128#define AWIN_CAN_BUS_TIME_PHSEG1 __BITS(19,16)
 3129#define AWIN_CAN_BUS_TIME_SJW __BITS(15,14)
 3130#define AWIN_CAN_BUS_TIME_TQ_BRP __BITS(9,0)
 3131
 3132/* CAN tx error warning limit register */
 3133#define AWIN_CAN_EWL_REG 0x18
 3134#define AWIN_CAN_EWL_ERR_WRN_LMT __BITS(7,0)
 3135
 3136/* CAN error counter register */
 3137#define AWIN_CAN_REC_REG 0x1c
 3138#define AWIN_CAN_REC_RX_ERR_CNT __BITS(23,16)
 3139#define AWIN_CAN_REC_TX_ERR_CNT __BITS(7,0)
 3140
 3141/* CAN receive message register */
 3142#define AWIN_CAN_RMSGC_REG 0x20
 3143#define AWIN_CAN_RMSGC_RX_MSG_CNT __BITS(7,0)
 3144
 3145/* CAN receive buffer start address register */
 3146#define AWIN_CAN_RSADDR_REG 0x24
 3147#define AWIN_CAN_RSADDR_RX_BUF_SADDR __BITS(5,0)
 3148
 3149/* CAN rx/tx message buffer 0 register */
 3150#define AWIN_CAN_TXBUF0_REG 0x40
 3151#define AWIN_CAN_TXBUF0_EFF __BIT(7)
 3152#define AWIN_CAN_TXBUF0_RTR __BIT(6)
 3153#define AWIN_CAN_TXBUF0_DL __BITS(3,0)
 3154
 3155/* CAN rx/tx message buffer registers */
 3156#define AWIN_CAN_TXBUF1_REG 0x44
 3157#define AWIN_CAN_TXBUF2_REG 0x48
 3158#define AWIN_CAN_TXBUF3_REG 0x4c
 3159#define AWIN_CAN_TXBUF4_REG 0x50
 3160#define AWIN_CAN_TXBUF5_REG 0x54
 3161#define AWIN_CAN_TXBUF6_REG 0x58
 3162#define AWIN_CAN_TXBUF7_REG 0x5c
 3163#define AWIN_CAN_TXBUF8_REG 0x60
 3164#define AWIN_CAN_TXBUF9_REG 0x64
 3165#define AWIN_CAN_TXBUF10_REG 0x68
 3166#define AWIN_CAN_TXBUF11_REG 0x6c
 3167#define AWIN_CAN_TXBUF12_REG 0x70
 3168
 3169/* CAN acceptance code 0 register */
 3170#define AWIN_CAN_ACPC 0x40
 3171
 3172/* CAN acceptance mask 0 register */
 3173#define AWIN_CAN_ACPM 0x44
 3174
 3175/* CAN transmit buffer for read back registers */
 3176#define AWIN_CAN_RBUF_RBACK0 0x180
 3177#define AWIN_CAN_RBUF_RBACK1 0x184
 3178#define AWIN_CAN_RBUF_RBACK2 0x188
 3179#define AWIN_CAN_RBUF_RBACK3 0x18c
 3180#define AWIN_CAN_RBUF_RBACK4 0x190
 3181#define AWIN_CAN_RBUF_RBACK5 0x194
 3182#define AWIN_CAN_RBUF_RBACK6 0x198
 3183#define AWIN_CAN_RBUF_RBACK7 0x19c
 3184#define AWIN_CAN_RBUF_RBACK8 0x1a0
 3185#define AWIN_CAN_RBUF_RBACK9 0x1a4
 3186#define AWIN_CAN_RBUF_RBACK10 0x1a8
 3187#define AWIN_CAN_RBUF_RBACK11 0x1ac
 3188#define AWIN_CAN_RBUF_RBACK12 0x1b0
 3189
3074#endif /* _ARM_ALLWINNER_AWIN_REG_H_ */ 3190#endif /* _ARM_ALLWINNER_AWIN_REG_H_ */