wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #ifndef __SCM_H |
| 25 | #define __SCM_H |
| 26 | |
| 27 | /*----------------*/ |
| 28 | /* CAN Structures */ |
| 29 | /*----------------*/ |
| 30 | |
| 31 | /* Message */ |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 32 | struct can_msg { |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 33 | uchar ctrl_0; |
| 34 | uchar ctrl_1; |
| 35 | uchar arbit_0; |
| 36 | uchar arbit_1; |
| 37 | uchar arbit_2; |
| 38 | uchar arbit_3; |
| 39 | uchar config; |
| 40 | uchar data[8]; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 41 | } __attribute__ ((packed)); |
| 42 | |
| 43 | typedef struct can_msg can_msg_t; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 44 | |
| 45 | /* CAN Register */ |
| 46 | typedef struct can_reg { |
| 47 | uchar ctrl; |
| 48 | uchar status; |
| 49 | uchar cpu_interface; |
| 50 | uchar resv0; |
| 51 | ushort high_speed_rd; |
| 52 | ushort gbl_mask_std; |
| 53 | uint gbl_mask_extd; |
| 54 | uint msg15_mask; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 55 | can_msg_t msg1; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 56 | uchar clkout; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 57 | can_msg_t msg2; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 58 | uchar bus_config; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 59 | can_msg_t msg3; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 60 | uchar bit_timing_0; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 61 | can_msg_t msg4; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 62 | uchar bit_timing_1; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 63 | can_msg_t msg5; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 64 | uchar interrupt; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 65 | can_msg_t msg6; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 66 | uchar resv1; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 67 | can_msg_t msg7; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 68 | uchar resv2; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 69 | can_msg_t msg8; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 70 | uchar resv3; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 71 | can_msg_t msg9; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 72 | uchar p1conf; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 73 | can_msg_t msg10; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 74 | uchar p2conf; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 75 | can_msg_t msg11; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 76 | uchar p1in; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 77 | can_msg_t msg12; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 78 | uchar p2in; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 79 | can_msg_t msg13; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 80 | uchar p1out; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 81 | can_msg_t msg14; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 82 | uchar p2out; |
Jean-Christophe PLAGNIOL-VILLARD | 5b464c2 | 2008-03-09 14:52:11 +0100 | [diff] [blame] | 83 | can_msg_t msg15; |
wdenk | 9998b51 | 2002-07-29 20:05:45 +0000 | [diff] [blame] | 84 | uchar ser_res_addr; |
| 85 | uchar resv_cs[0x8000-0x100]; /* 0x8000 is the min size for CS */ |
| 86 | } can_reg_t; |
| 87 | |
| 88 | |
| 89 | #endif /* __SCM_H */ |