Hi,

I have committed this patch to add BF527 SDP board bus support. I did
the test by detectflash, but did not try flashmem.

Regards,
Jie
  * src/bus/buses_list.h: Add bf527_sdp.
  * src/bus/Makefile.am(libbus_la_SOURCES): Add bf527_sdp.c.
  * src/bus/bf527_sdp.c: New file.

Index: src/bus/buses_list.h
===================================================================
--- src/bus/buses_list.h	(revision 1991)
+++ src/bus/buses_list.h	(working copy)
@@ -44,6 +44,7 @@
 _URJ_BUS(bf51x)
 _URJ_BUS(bf526_ezkit)
 _URJ_BUS(bf527_ezkit)
+_URJ_BUS(bf527_sdp)
 _URJ_BUS(bf52x)
 _URJ_BUS(bf533_ezkit)
 _URJ_BUS(bf533_stamp)
Index: src/bus/Makefile.am
===================================================================
--- src/bus/Makefile.am	(revision 1991)
+++ src/bus/Makefile.am	(working copy)
@@ -56,6 +56,7 @@
 	blackfin.c \
 	blackfin.h \
 	bf518f_ezbrd.c \
+	bf527_sdp.c \
 	bf533_stamp.c \
 	bf537_stamp.c \
 	bf548_ezkit.c \
Index: src/bus/bf527_sdp.c
===================================================================
--- src/bus/bf527_sdp.c	(revision 0)
+++ src/bus/bf527_sdp.c	(revision 0)
@@ -0,0 +1,87 @@
+/*
+ * $Id$
+ *
+ * Analog Devices ADSP-BF527 SDP board bus driver
+ * Copyright (C) 2011 Analog Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by Jie Zhang <[email protected]>, 2011.
+ */
+
+#include "blackfin.h"
+
+typedef struct
+{
+    bfin_bus_params_t params; /* needs to be first */
+    urj_part_signal_t *pg0;   /* ~FLASH_EN */
+} bus_params_t;
+
+#define PG0    ((bus_params_t *) bus->params)->pg0
+
+static void
+bf527_sdp_select_flash (urj_bus_t *bus, uint32_t addr)
+{
+    urj_part_t *part = bus->part;
+
+    urj_part_set_signal (part, PG0, 1, 0);
+}
+
+static void
+bf527_sdp_unselect_flash (urj_bus_t *bus)
+{
+    urj_part_t *part = bus->part;
+
+    urj_part_set_signal (part, PG0, 1, 1);
+}
+
+static urj_bus_t *
+bf527_sdp_bus_new (urj_chain_t *chain, const urj_bus_driver_t *driver,
+                   const urj_param_t *cmd_params[])
+{
+    urj_bus_t *bus;
+    urj_part_t *part;
+    bfin_bus_params_t *params;
+    int failed = 0;
+
+    bus = urj_bus_generic_new (chain, driver, sizeof (bus_params_t));
+    if (bus == NULL)
+        return NULL;
+    part = bus->part;
+
+    params = bus->params;
+    params->async_size = 4 * 1024 * 1024;
+    params->ams_cnt = 4;
+    params->abe_cnt = 2;
+    params->addr_cnt = 19;
+    params->data_cnt = 16;
+    params->sdram = 1;
+    params->select_flash = bf527_sdp_select_flash;
+    params->unselect_flash = bf527_sdp_unselect_flash;
+    failed |= bfin_bus_new (bus, cmd_params);
+
+    failed |= urj_bus_generic_attach_sig (part, &PG0, "PG0");
+
+    if (failed)
+    {
+        urj_bus_generic_free (bus);
+        return NULL;
+    }
+
+    return bus;
+}
+
+BFIN_BUS_DECLARE(bf527_sdp, "BF527 SDP board");
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to