-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-imx28
128 lines (110 loc) · 3.21 KB
/
Makefile-imx28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# can4linux -- LINUX device driver Makefile
# Copyright (c) 2008 port GmbH Halle/Saale
# Used release tag for this software version
include $(PWD)/version.inc
#
# The driver major device number
# The new linux/Documentation/devices.txt defines major=91 for CAN
CAN_MAJOR= 91
CAN_MODULE = can4linux
TARGET=IMX28
# location of the compiled objects and the final driver module
OBJDIR = obj
# Debugging Code within the driver
# to use the Debugging option
# and the Debugging control via /proc/sys/dev/Can/DbgMask
# the Makefile in subdir Can must called with the DEBUG set to
# DEBUG=1
# else
# NODEBUG
# doesn't compile any debug code into the driver
DEBUG=NODEBUG
DEBUG=DEBUG=1
# all definitions for compiling the sources
# CAN_PORT_IO - use port I/O instead of memory I/O
# CAN_INDEXED_PORT_IO - CAN registers adressed by a pair of registers
# one is selcting the register the other one does i/O
# used eg. on Elan CPUs
# CAN4LINUX_PCI
# IODEBUG - all register write accesses are logged
# CONFIG_TIME_MEASURE=1 - enable Time measurement at parallel port
#
# MAX_CHANNELS - max number of minor inodes supported
#
# CAN_MAX_OPEN - the driver can be opened more than once
# the number specifies the number of possible
# different process, the number of RX queues
# the driver has to handle
#
# select the sys clock according the values used in your design
# and if the bus clock or the cpu clock is used, depending on
# the bit CLK_SRC of the CAN control register CTRL
# -DCAN_SYSCLK=66500000
# -DCAN_SYSCLK=24000000
# -DCAN_IS_USING_BUS_CLOCK BUS or crystal clock ??
# In the past the driver had some problems related to CAN_SendMessage()
# select one of the #defines here
# OLD_MBOX_TEST
# PROD_MBOX_TEST
# or nothing
#
# Ka-Ro TX28 Module
# using memory mapped FlexCAN module
# i.MX28 Applications Processor Reference Manual, Rev. 1, 2010
DEFS = -DKARO_TX28 \
-D$(TARGET) -D$(DEBUG) -DDEFAULT_DEBUG -DCAN_MAJOR=$(CAN_MAJOR) \
-DCAN_SYSCLK=24000000 \
-DMAX_CHANNELS=2 -DCAN_MAX_OPEN=2\
-Wno-undef \
-DPROD_MBOX_TEST \
-DMAX_BUFSIZE=256
#-DCONFIG_TIME_MEASURE=1
EXTRA_CFLAGS = $(DEFS) -DVERSION=\"$(DVERSION)_$(TARGET)\ $(SVNVERSION)\"
PWD := $(shell pwd)
obj-m := $(CAN_MODULE).o
# add other object modules here
$(CAN_MODULE)-objs:= core.o \
open.o \
read.o \
write.o \
ioctl.o \
select.o \
debug.o \
util.o \
sysctl.o \
async.o \
close.o \
imx35.o \
imx35funcs.o \
.PHONY: all
all:
@echo "CURDIR = $(CURDIR)"
@echo "CC = $(CC)"
test ! -d $(KDIR) || $(MAKE) -C $(KDIR) M=$(PWD) TARGET=$(TARGET) modules
clean:
test ! -d $(KDIR) || $(MAKE) -C $(KDIR) M=$(PWD) TARGET=$(TARGET) clean
#install:
# cp can.ko
# -mknod /dev/can0 c $(CAN_MAJOR) 0
# chmod 666 /dev/can0
inode:
@ echo "mknod /dev/can0 c 91 0"
# create a soure archive
tar:
tar zcvf ../c4limx.tgz \
core.c \
open.c \
read.c \
write.c \
ioctl.c \
select.c \
debug.c \
util.c \
sysctl.c \
async.c \
close.c \
imx35.c \
imx35funcs.c \
version.inc \
can4linux.h defs.h debug.h imx35flexcan.h imx35.h \
Makefile Makefile-imx* target cross-imx*