]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/esd/tasreg/tasreg.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / board / esd / tasreg / tasreg.c
index 64e6d632962fce07d07a382d123b8914c8c972da..09a90ed2d042d174aff52afe3465a21d2cc47bd8 100644 (file)
@@ -2,34 +2,17 @@
  * (C) Copyright 2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <command.h>
 #include <malloc.h>
 #include <asm/m5249.h>
+#include <asm/io.h>
 
 
 /* Prototypes */
-int gunzip(void *, int, unsigned char *, unsigned long *);
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
 int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
 
@@ -118,7 +101,7 @@ phys_size_t initdram (int board_type) {
 
        /** Precharge sequence **/
        mbar_writeLong(MCFSIM_DACR0, 0x0000332c); /* Set DACR0[IP] (bit 3) */
-       *((volatile unsigned long *) 0x00) = junk; /* write to a memory location to init. precharge */
+       out_be32((void *)0, junk); /* write to a memory location to init. precharge */
        udelay(0x10); /* Allow several Precharge cycles */
 
        /** Refresh Sequence **/
@@ -127,7 +110,7 @@ phys_size_t initdram (int board_type) {
 
        /** Mode Register initialization **/
        mbar_writeLong(MCFSIM_DACR0, 0x0000b364);  /* Enable DACR0[IMRS] (bit 6); RE remains enabled */
-       *((volatile unsigned long *) 0x800) = junk; /* Access RAM to initialize the mode register */
+       out_be32((void *)0x800, junk); /* Access RAM to initialize the mode register */
 
        return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
 };
@@ -219,7 +202,7 @@ int i2c_probe(uchar addr);
 
 /*
  */
-int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
 
@@ -230,7 +213,7 @@ int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        addr = simple_strtol (argv[1], NULL, 16);
 
-       printf("iprobe looping on addr 0x%lx (cntrl-c aborts)...\n", addr);
+       printf("i2c probe looping on addr 0x%lx (cntrl-c aborts)...\n", addr);
 
        for (;;) {
                i2c_probe(addr);
@@ -248,17 +231,17 @@ int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        iploop, 2,      1,      do_iploop,
-       "iploop - iprobe loop <addr>\n",
-       NULL
-       );
+       "i2c probe loop <addr>",
+       ""
+);
 
 /*
  */
-int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        uchar buf[8];
 
-       *(volatile ushort *)0xe0000000 = 0x4000;
+       out_be16((void *)0xe0000000, 0x4000);
 
        udelay(5000); /* wait for 5ms */
 
@@ -301,13 +284,13 @@ int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        codec,  1,      1,      do_codec,
-       "codec - Enable codec\n",
-       NULL
-       );
+       "Enable codec",
+       ""
+);
 
 /*
  */
-int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
        ulong instr;
@@ -334,13 +317,13 @@ int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        saa,    5,      1,      do_saa,
-       "saa    - Write to SAA1064 <addr> <instr> <cntrl> <data>\n",
-       NULL
-       );
+       "Write to SAA1064 <addr> <instr> <cntrl> <data>",
+       ""
+);
 
 /*
  */
-int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
        ulong data0;
@@ -373,13 +356,13 @@ int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        iwrite, 6,      1,      do_iwrite,
-       "iwrite - Write n bytes to I2C-device\n",
-       "addr cnt data0 ... datan\n"
-       );
+       "Write n bytes to I2C-device",
+       "addr cnt data0 ... datan"
+);
 
 /*
  */
-int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
        ulong cnt;
@@ -405,13 +388,13 @@ int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        iread,  3,      1,      do_iread,
-       "iread  - Read from I2C <addr> <cnt>\n",
-       NULL
-       );
+       "Read from I2C <addr> <cnt>",
+       ""
+);
 
 /*
  */
-int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
        uchar buf[32];
@@ -443,7 +426,7 @@ int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 U_BOOT_CMD(
        ireadl, 2,      1,      do_ireadl,
-       "ireadl - Read-loop from I2C <addr>\n",
-       NULL
-       );
+       "Read-loop from I2C <addr>",
+       ""
+);
 #endif