]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/dataflash.c
Merge git://www.denx.de/git/u-boot-marvell
[u-boot] / drivers / mtd / dataflash.c
index 96cd395e71a7ad30ab230cc1b56f040e3bcc0e7c..e961f518b085107e34636cb868f2316cc6508fdd 100644 (file)
@@ -1,21 +1,8 @@
-/* LowLevel function for ATMEL DataFlash support
+/*
+ * LowLevel function for ATMEL DataFlash support
  * Author : Hamid Ikdoumi (Atmel)
  *
- * 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
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <config.h>
@@ -39,7 +26,6 @@ int AT91F_DataflashInit (void)
        int i, j;
        int dfcode;
        int part;
-       int last_part;
        int found[CONFIG_SYS_MAX_DATAFLASH_BANKS];
        unsigned char protected;
 
@@ -63,7 +49,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                case AT45DB081:
@@ -75,7 +61,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                case AT45DB161:
@@ -87,7 +73,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                case AT45DB321:
@@ -99,7 +85,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                case AT45DB642:
@@ -111,7 +97,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                case AT45DB128:
@@ -123,7 +109,7 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].Desc.DataFlash_state = IDLE;
                        dataflash_info[i].logical_address = cs[i].addr;
                        dataflash_info[i].id = dfcode;
-                       found[i] += dfcode;;
+                       found[i] += dfcode;
                        break;
 
                default:
@@ -136,7 +122,6 @@ int AT91F_DataflashInit (void)
                                dataflash_info[i].Device.pages_size) - 1;
 
                part = 0;
-               last_part = 0;
                /* set the area addresses */
                for(j = 0; j < NB_DATAFLASH_AREA; j++) {
                        if(found[i]!=0) {
@@ -147,7 +132,6 @@ int AT91F_DataflashInit (void)
                                        dataflash_info[i].Device.area_list[j].end =
                                                dataflash_info[i].end_address +
                                                dataflash_info[i].logical_address;
-                                       last_part = 1;
                                } else {
                                        dataflash_info[i].Device.area_list[j].end =
                                                area_list[part].end +
@@ -171,7 +155,7 @@ int AT91F_DataflashInit (void)
        return found[0];
 }
 
-void AT91F_DataflashSetEnv (void)
+void AT91F_Dataflashenv_set(void)
 {
        int i, j;
        int part;
@@ -185,8 +169,9 @@ void AT91F_DataflashSetEnv (void)
                        /* Set the environment according to the label...*/
                        if((env & FLAG_SETENV) == FLAG_SETENV) {
                                start = dataflash_info[i].Device.area_list[j].start;
-                               sprintf((char*) s,"%lX",start);
-                               setenv((char*) area_list[part].label,(char*) s);
+                               sprintf((char *)s, "%lX", start);
+                               env_set((char *)area_list[part].label,
+                                       (char *)s);
                        }
                        part++;
                }