]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc512x/serial.c
Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master'
[u-boot] / arch / powerpc / cpu / mpc512x / serial.c
index 58587fd5bcf59c78446a5a52f89e055ededdff39..4105a28509143d48f402ee7c2b43eb089b473c50 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000 - 2010
  * 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+
  *
  * Based ont the MPC5200 PSC driver.
  * Adapted for MPC512x by Jan Wrobel <wrr@semihalf.com>
@@ -140,7 +124,7 @@ void serial_setbrg_dev(unsigned int idx)
        }
 
        /* calculate divisor for setting PSC CTUR and CTLR registers */
-       baseclk = (gd->ips_clk + 8) / 16;
+       baseclk = (gd->arch.ips_clk + 8) / 16;
        div = (baseclk + (baudrate / 2)) / baudrate;
 
        out_8(&psc->ctur, (div >> 8) & 0xff);
@@ -400,7 +384,7 @@ struct stdio_dev *open_port(int num, int baudrate)
                sprintf(env_val, "%d", baudrate);
                setenv(env_var, env_val);
 
-               if (port->start())
+               if (port->start(port))
                        return NULL;
 
                set_bit(num, &initialized);
@@ -423,7 +407,7 @@ int close_port(int num)
        if (!port)
                return -1;
 
-       ret = port->stop();
+       ret = port->stop(port);
        clear_bit(num, &initialized);
 
        return ret;
@@ -434,7 +418,7 @@ int write_port(struct stdio_dev *port, char *buf)
        if (!port || !buf)
                return -1;
 
-       port->puts(buf);
+       port->puts(port, buf);
 
        return 0;
 }
@@ -449,8 +433,8 @@ int read_port(struct stdio_dev *port, char *buf, int size)
        if (!size)
                return 0;
 
-       while (port->tstc()) {
-               buf[cnt++] = port->getc();
+       while (port->tstc(port)) {
+               buf[cnt++] = port->getc(port);
                if (cnt > size)
                        break;
        }