]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Clean up: Removed fake board mpc5200_midam
authorMartin Petera <martin.petera@gmail.com>
Tue, 2 Feb 2010 19:20:50 +0000 (20:20 +0100)
committerMartin Petera <martin.petera@gmail.com>
Tue, 2 Feb 2010 19:20:50 +0000 (20:20 +0100)
lincan/include/mpc5200.h
lincan/src/Makefile.omk
lincan/src/boardlist.c
lincan/src/mpc5200.c
lincan/src/mpc5200_midam.c [deleted file]

index 23e5a86e305875b82ead6dd2f6b97948737cce25..e709699e26d259dacb6c965ab0cd0e6cd4d0881e 100644 (file)
  * however MIDAM board uses only one controler
  * RYU board uses both
  */
-#ifdef MSCAN_MIDAM
-       #define NR_MSCAN        1
-#else
-       #define NR_MSCAN        2
-#endif /* MSCAN_MIDAM */
-
-
 #define NR_82527       0
 #define NR_SJA1000     0
-#define NR_ALL         (NR_82527 + NR_SJA1000 + NR_MSCAN)
+#define NR_ALL         (NR_82527 + NR_SJA1000 + 2)
+#define NR_ALL_MIDAM   (NR_ALL - 1)
+
 
 
 /* IRQ is read from OpenFirmware nodes */
index db54582bae5c3046ccefc6ed6e50d52551ae5487..155dee403e11f30aa1a0d99d010240a9dc85adb1 100644 (file)
@@ -2,7 +2,7 @@ lincan_cards_NAMES = pip pccan smartcan nsi cc_can104 ems_cpcpci \
                pc_i03 pcm3680 aim104 m437 pcccan ssv bfadcan gensja1000io gensja1000mm eb8245 \
                kv_pcican msmcan oscar adlink7841 pcan_pci esdpci200 unican virtual template
 
-lincan_morecards_NAMES = esdpci266 hms30c7202_can ns_dev_can ipci165 pimx1 tscan1 ts7kv nsi_canpci sh7760 mpc5200 mpc5200_midam
+lincan_morecards_NAMES = esdpci266 hms30c7202_can ns_dev_can ipci165 pimx1 tscan1 ts7kv nsi_canpci sh7760 mpc5200
 
 default_CONFIG = CONFIG_OC_LINCAN=y CONFIG_OC_LINCANRTL=n CONFIG_OC_LINCANVME=n
 default_CONFIG += CONFIG_OC_LINCAN_PORTIO_ONLY=n CONFIG_OC_LINCAN_MEMIO_ONLY=n
@@ -45,11 +45,6 @@ endif
 # both cannot be selected, full MPC5200 has precedence
 ifeq ($(CONFIG_OC_LINCAN_CARD_mpc5200),y)
 lincan_cards_SOURCES += mscan.c
-else
-ifeq ($(CONFIG_OC_LINCAN_CARD_mpc5200_midam),y)
-lincan_cards_SOURCES += mscan.c
-linux_INCLUDES += -DMSCAN_MIDAM
-endif
 endif
 
 ifneq ($(CONFIG_OC_LINCANRTL),y)
index a52f2d4e3edad19c9be5fb0d3cdb494a6d362e59..7623ea353bc08e04c10742dd797a824543d3cd71 100644 (file)
@@ -78,6 +78,7 @@ extern int esdpci200_register(struct hwspecops_t *hwspecops);
 extern int esdpci266_register(struct hwspecops_t *hwspecops);
 extern int sh7760_register(struct hwspecops_t *hwspecops);
 extern int mpc5200_register(struct hwspecops_t *hwspecops);
+extern int mpc5200_midam_register(struct hwspecops_t *hwspecops);
 
 const struct boardtype_t can_boardtypes[]={
     #ifdef CONFIG_OC_LINCAN_CARD_template
@@ -205,10 +206,7 @@ const struct boardtype_t can_boardtypes[]={
     #endif
     #if defined(CONFIG_OC_LINCAN_CARD_mpc5200)
        {"mpc5200", mpc5200_register, 0},
-    #else
-        #if defined(CONFIG_OC_LINCAN_CARD_mpc5200_midam)
-           {"mpc5200", mpc5200_register, 0},
-        #endif
+       {"mpc5200_midam", mpc5200_midam_register, 0},
     #endif
        {NULL}
 };
index 9371eca369e33ca39a706f76323ada5c20b059c4..4f67d2494f1be7578ee9130415950b65f042bbab 100644 (file)
@@ -137,6 +137,19 @@ int mpc5200_init_hw_data(struct candevice_t *candev)
 
        return 0;
 }
+
+/* special function for midam board */
+int mpc5200_midam_init_hw_data(struct candevice_t *candev)
+{
+       /* use same init routine */
+       mpc5200_init_hw_data(candev);
+
+       /* modify chip count */
+       candev->nr_all_chips = NR_ALL_MIDAM;
+
+       return 0;
+}
+
 int mpc5200_init_chip_data(struct candevice_t *candev, int chipnr)
 {
        mscan_fill_chipspecops(candev->chip[chipnr]);
@@ -196,6 +209,16 @@ int mpc5200_register(struct hwspecops_t *hwspecops)
        return 0;
 }
 
+int mpc5200_midam_register(struct hwspecops_t *hwspecops)
+{
+       /* use same register routine for MIDAM board */
+       mpc5200_register(hwspecops);
+
+       /* use specific init_hw_data */
+       hwspecops->init_hw_data = mpc5200_midam_init_hw_data;
+
+       return 0;
+}
 
 int mpc5200_init_device_node(struct canchip_t * chip, struct device_node * devnode)
 {
diff --git a/lincan/src/mpc5200_midam.c b/lincan/src/mpc5200_midam.c
deleted file mode 100644 (file)
index f1d9d48..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**************************************************************************/
-/* File: mpc5200-midam.c - Freescale MPC5200 MSCAN controller support,    */
-/*                         fake file for MIDAM board                      */
-/*                                                                        */
-/* LinCAN - (Not only) Linux CAN bus driver                               */
-/* Copyright (C) 2002-2009 DCE FEE CTU Prague <http://dce.felk.cvut.cz>   */
-/* Copyright (C) 2002-2009 Pavel Pisa <pisa@cmp.felk.cvut.cz>             */
-/* Copyright (C) 2007-2008 Martin Petera <peterm4@fel.cvut.cz>            */
-/* Funded by OCERA and FRESCOR IST projects                               */
-/* Based on CAN driver code by Arnaud Westenberg <arnaud@wanadoo.nl>      */
-/*                                                                        */
-/* LinCAN is free software; you can redistribute it and/or modify it      */
-/* under terms of the GNU General Public License as published by the      */
-/* Free Software Foundation; either version 2, or (at your option) any    */
-/* later version.  LinCAN is distributed in the hope that it will be      */
-/* useful, but WITHOUT ANY WARRANTY; without even the implied warranty    */
-/* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    */
-/* General Public License for more details. You should have received a    */
-/* copy of the GNU General Public License along with LinCAN; see file     */
-/* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
-/* Cambridge, MA 02139, USA.                                              */
-/*                                                                        */
-/* To allow use of LinCAN in the compact embedded systems firmware        */
-/* and RT-executives (RTEMS for example), main authors agree with next    */
-/* special exception:                                                     */
-/*                                                                        */
-/* Including LinCAN header files in a file, instantiating LinCAN generics */
-/* or templates, or linking other files with LinCAN objects to produce    */
-/* an application image/executable, does not by itself cause the          */
-/* resulting application image/executable to be covered by                */
-/* the GNU General Public License.                                        */
-/* This exception does not however invalidate any other reasons           */
-/* why the executable file might be covered by the GNU Public License.    */
-/* Publication of enhanced or derived LinCAN files is required although.  */
-/**************************************************************************/
-
-#include "mpc5200.c"