Port-arm archive

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

Re: Garbage characters instead of prompt on beaglebone



I found the problem, MDR1 is overwriting LCR. Following diff fixes it for me.
Thanks,

Lwazi

-------
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 76e4635..ba661ea 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.354
2018/12/11 06:34:00 thorpej Exp $");
 #include <dev/ic/st16650reg.h>
 #include <dev/ic/hayespreg.h>
 #define    com_lcr    com_cfcr
+#define    com_mdr1    8
 #include <dev/cons.h>

 #include "ioconf.h"
@@ -240,9 +241,9 @@ void    com_kgdb_putc(void *, int);
     com_data, com_data, com_dlbl, com_dlbh, com_ier, com_iir, com_fifo, \
     com_efr, com_lcr, com_mcr, com_lsr, com_msr, 0, 0, 0, 0, 0, 0, 0, 0, \
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, com_usr, com_tfl, com_rfl, \
-    0, 0, 0, 0, 0, 0, 0, com_halt }
+    0, 0, 0, 0, 0, 0, 0, com_halt, com_mdr1 }

-static const bus_size_t com_std_map[42] = COM_REG_STD;
+static const bus_size_t com_std_map[CR_MAP_SIZE] = COM_REG_STD;

 #define    COMDIALOUT_MASK    TTDIALOUT_MASK

diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h
index cc4e892..2a156c3 100644
--- a/sys/dev/ic/comvar.h
+++ b/sys/dev/ic/comvar.h
@@ -76,6 +76,8 @@ int com_is_console(bus_space_tag_t, bus_addr_t,
bus_space_handle_t *);
 #define    COM_RING_SIZE    2048
 #endif

+#define    CR_MAP_SIZE        43
+
 #define    COM_REG_RXDATA        0
 #define    COM_REG_TXDATA        1
 #define    COM_REG_DLBL        2
@@ -87,7 +89,7 @@ int com_is_console(bus_space_tag_t, bus_addr_t,
bus_space_handle_t *);
 #define    COM_REG_EFR        7
 #define    COM_REG_TLR        7
 #define    COM_REG_LCR        8
-#define    COM_REG_MDR1        8
+#define    COM_REG_MDR1        42
 #define    COM_REG_MCR        9
 #define    COM_REG_LSR        10
 #define    COM_REG_MSR        11
@@ -101,7 +103,7 @@ struct com_regs {
     bus_space_handle_t    cr_ioh;
     bus_addr_t        cr_iobase;
     bus_size_t        cr_nports;
-    bus_size_t        cr_map[42];
+    bus_size_t        cr_map[CR_MAP_SIZE];
 };

 void    com_init_regs(struct com_regs *, bus_space_tag_t, bus_space_handle_t,

On Thu, 10 Jan 2019 at 19:43, Jason Thorpe <thorpej%me.com@localhost> wrote:
>
>
>
> > On Jan 10, 2019, at 4:17 PM, Lwazi Dube <lwazeh%gmail.com@localhost> wrote:
> >
> > Hi,
> >
> > I see garbage characters instead of a prompt on beaglebone (white)
> > after this commit.
>
> I'll take a look ... something is obviously working because the kernel messages work.
>
> >
> > commit 2b9bd6fcfd390f7e97c22b561d973003d37a44f3
> > Author: thorpej <thorpej%netbsd.org@localhost>
> > Date:   Sat Dec 8 21:14:37 2018 +0000
> >
> >    Remove the COM_REGMAP option -- just use it all the time.  While here,
> >    garbage-collect the COM_FUNCMAP and COM_AU1X00 options, as there are
> >    not used anywhere.
> > ------------
> > BEFORE:
> >
> > [   9.4244983] kern.module.path=/stand/evbarm/8.99.27/modules
> > [   9.4244983] WARNING: no TOD clock present
> > [   9.4340047] WARNING: using filesystem time
> > [   9.4381077] WARNING: CHECK AND RESET THE DATE!
> > [   9.4426188] init path (default /sbin/init):
> > [  10.4332433] init: copying out path `/sbin/init' 11
> > /etc/rc.conf is not configured.  Multiuser boot aborted.
> > Enter pathname of shell or RETURN for /bin/sh:
> > We recommend that you create a non-root account and use su(1) for root access.
> > #
> >
> > AFTER:
> > [   9.8133793] kern.module.path=/stand/evbarm/8.99.27/modules
> > [   9.8133793] WARNING: no TOD clock present
> > [   9.8229186] WARNING: using filesystem time
> > [   9.8270118] WARNING: CHECK AND RESET THE DATE!
> > [   9.8326220] init path (default /sbin/init):
> > [   9.8370086] init: copying out path `/sbin/init' 11
> > ���􅢴"�K�%�% �шC�������� �/ �ɉ�2���ɠ�)�3��>�>�>�>�>�>��>��>�����྾��>���� f7�5f侱=
> > ��!� ��0 ҍ��Ҡ�ʥ4d�G�N�� ��� 0�밵 �
>
> -- thorpej
>


Home | Main Index | Thread Index | Old Index