Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcsh/dev/hd64461 Suply clock SAFECKE_[IO]ST, if pl...



details:   https://anonhg.NetBSD.org/src/rev/7eaab52b2dc5
branches:  trunk
changeset: 754788:7eaab52b2dc5
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Wed May 12 18:16:53 2010 +0000

description:
Suply clock SAFECKE_[IO]ST, if platid is PERSONA.
  tested on HPW-50PA.

diffstat:

 sys/arch/hpcsh/dev/hd64461/hd64461uart.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (60 lines):

diff -r 8d6c78674035 -r 7eaab52b2dc5 sys/arch/hpcsh/dev/hd64461/hd64461uart.c
--- a/sys/arch/hpcsh/dev/hd64461/hd64461uart.c  Wed May 12 17:56:13 2010 +0000
+++ b/sys/arch/hpcsh/dev/hd64461/hd64461uart.c  Wed May 12 18:16:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $        */
+/*     $NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $        */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $");
 
 #include "opt_kgdb.h"
 
@@ -45,6 +45,8 @@
 #include <machine/bus.h>
 #include <machine/intr.h>
 #include <machine/console.h>
+#include <machine/platid.h>
+#include <machine/platid_mask.h>
 
 #include <dev/ic/comvar.h>
 #include <dev/ic/comreg.h>
@@ -153,7 +155,7 @@
        struct hd64461_attach_args *ha = aux;
        struct hd64461uart_softc *sc = device_private(self);
        struct com_softc *csc = &sc->sc_com;
-       uint16_t r16;
+       uint16_t r16, or16;
        bus_space_handle_t ioh;
 
        csc->sc_dev = self;
@@ -171,17 +173,19 @@
        /* switch port to UART */
 
        /* supply clock */
-       r16 = hd64461_reg_read_2(HD64461_SYSSTBCR_REG16);
+       r16 = or16 = hd64461_reg_read_2(HD64461_SYSSTBCR_REG16);
        r16 &= ~HD64461_SYSSTBCR_SURTSD;
+       if (platid_match(&platid, &platid_mask_MACH_HITACHI_PERSONA))
+               r16 &= ~(HD64461_SYSSTBCR_SAFECKE_IST |
+                   HD64461_SYSSTBCR_SAFECKE_OST);
        hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, r16);
 
        /* sanity check */
        if (!com_probe_subr(&csc->sc_regs)) {
                aprint_error(": device problem. don't attach.\n");
 
-               /* stop clock */
-               r16 |= HD64461_SYSSTBCR_SURTSD;
-               hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, r16);
+               /* restore old clock */
+               hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, or16);
                return;
        }
 



Home | Main Index | Thread Index | Old Index