Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2022 22:18:45 +0900
From:      =?UTF-8?B?SGlyb28gT25vICjlsI/ph47lr5vnlJ8p?= <hiroo.ono+freebsd@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Mark Millard <marklmi@yahoo.com>, freebsd-arm@freebsd.org
Subject:   Re: Still did not succeed to boot on Lenovo Yoga C630
Message-ID:  <CANtk6SjStgG4fR19ZCmK3SwMVCkTAP4q06zGj5ivdXASpjEFGg@mail.gmail.com>
In-Reply-To: <CANtk6Sj9EiF1fjEPU6R4xhaTrUTuLCRTz2ZdkBQZoQv1qTY%2BZA@mail.gmail.com>
References:  <CANtk6SgUoqC_Jgdtu=CZnFvnLzqP445MQqfwhV5%2BBgX_%2BVFUZA@mail.gmail.com> <B55013C7-B04C-48E4-BC0F-C106DA08348F@yahoo.com> <CANtk6Shwaea09TiTZq3UZwzCoXjm8TqkA930QQwS_i3_Awd5bg@mail.gmail.com> <CANCZdfqpTW3AVHPfHPWOEpEW2QPTE6aADGNzhH=pQT4btA1%2BvQ@mail.gmail.com> <CANtk6Si4Eg3vd4j3wvgCt%2BoodpNK7ikei-XikEmXPMdQUane3w@mail.gmail.com> <CANCZdfpKnxeRp3RtPGrq%2BsCMqXjq0AnYWuN2orHt1qt57KRh0Q@mail.gmail.com> <CANtk6ShzbOcw%2B86J_M_AQeDHU36ptQG%2Bj7XndYzhCJ3E0N0Qqw@mail.gmail.com> <CANtk6ShVXDHt5K0UoGaMgw0o_w3HPCMPGYdu-m1hCUkZ3ZMcUQ@mail.gmail.com> <CANCZdfqyMUUDVgg4YHZNaXGVb9E8TXmFH0jtQuXN0TkCti46vQ@mail.gmail.com> <CANtk6SgeCFSwkRpXDd9DsR%2BN%2BNNa_c9pm6-8u6c9Q2au0ZiWZA@mail.gmail.com> <CANCZdfrF8P0FgU-E-n8hgNVshg3BBJuCuYOdTwEz4DMQ3mPDvg@mail.gmail.com> <CANtk6Sjs15P1oWyJcbzmHtmeHvkNjrqzcvo82qGm=PcheZmZoQ@mail.gmail.com> <CANtk6Sj9EiF1fjEPU6R4xhaTrUTuLCRTz2ZdkBQZoQv1qTY%2BZA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000090433705f092be5b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Sorry again.
The patch is needed for
* stand/efi/loader/arch/arm64/start.S
* stand/efi/loader/arch/arm64/ldscript.arm64
* stand/efi/loader/Makefile

I forgot the last one. I remade the patch for three.

2022=E5=B9=B412=E6=9C=8824=E6=97=A5(=E5=9C=9F) 22:11 Hiroo Ono (=E5=B0=8F=
=E9=87=8E=E5=AF=9B=E7=94=9F) <hiroo.ono+freebsd@gmail.com>:
>
> 2022=E5=B9=B412=E6=9C=8824=E6=97=A5(=E5=9C=9F) 10:35 Hiroo Ono (=E5=B0=8F=
=E9=87=8E=E5=AF=9B=E7=94=9F) <hiroo.ono+freebsd@gmail.com>:
> >
> > > I run other arm64 machines w/o issue with the current code.
> >
> > Yes, Qualcomm's snapdragon is weird. I saw Linux people complain about
> > it somewhere... Wanted to know  before I bought this Yoga C630.
> >
> > 2022=E5=B9=B412=E6=9C=8824=E6=97=A5(=E5=9C=9F) 10:03 Warner Losh <imp@b=
sdimp.com>:
> > >
> > >
> > >
> > > On Fri, Dec 23, 2022 at 5:49 PM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=
=9B=E7=94=9F) <hiroo.ono+freebsd@gmail.com> wrote:
> > >>
> > >> The current status of FreeBSD 14-current on Lenovo Yoga C630 is as f=
ollows:
> > >>
> > >>  1) Merging from OpenBSD's loader code made the loader boot apart fr=
om
> > >> 3 points (#2 to 4 ).
> > >>  2) when comconsole->c_init() runs the 2nd time, it seems to freeze.
> > >> (might be C630 specific)
> > >>  3) SetVirtualAddressMap() in efi_do_vmap() freezes. (might also
> > >> affect other snapdragon systems like Microsoft Arm Developer Kit)
> > >>  4) The kernel is kicked but does not start.
> > >>
> > >> 1) is quite straightforward. What needs to be changed is
> > >> stand/efi/loader/arch/arm64/start.S.
> > >
> > >
> > > Can you share what needs to be done? To my eye, we don't need any cha=
nges, so it would be good to know what you've had to do exactly.
> >
> > Attached is the diff to start.S. There are 3 points.
> > 1) The loader has to be aligned to 4kb.
> > 2) Proper characteristic value should be in the PE header.
> > 3) .text and .data segment have to be separate.
> >
> > It is from OpenBSD:
> > https://github.com/openbsd/src/blob/master/sys/arch/arm64/stand/efiboot=
/start.S
>
> Sorry patch to ldscript.arm64 was missing.
> I am going to test your serial patch now.
>
>
> > >> For 2), I do not know what to do. Currently, I commented out
> > >> comconsole from struct console *consoles[] in stand/efi/loader/conf.=
c
> > >> as a workaround. Maybe, I should write a fault handler that helps
> > >> returning from the fault.
> > >
> > >
> > > There were problems with this with HyperV on aarch64 too.
> > >
> > > Something like
> > > diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiser=
ialio.c
> > > index 8b3f8e83e0b3..54ee39096685 100644
> > > --- a/stand/efi/loader/efiserialio.c
> > > +++ b/stand/efi/loader/efiserialio.c
> > > @@ -261,11 +261,11 @@ comc_probe(struct console *sc)
> > >                 if (comc_port =3D=3D NULL)
> > >                         return;
> > >         }
> > > -       comc_port->baudrate =3D COMSPEED;
> > > +       comc_port->baudrate =3D 0;
> > >         comc_port->ioaddr =3D 0;                  /* default port */
> > > -       comc_port->databits =3D 8;                /* 8,n,1 */
> > > -       comc_port->parity =3D NoParity;           /* 8,n,1 */
> > > -       comc_port->stopbits =3D OneStopBit;       /* 8,n,1 */
> > > +       comc_port->databits =3D 0;                /* 8,n,1 */
> > > +       comc_port->parity =3D 0;          /* 8,n,1 */
> > > +       comc_port->stopbits =3D 0;        /* 8,n,1 */
> > >         comc_port->ignore_cd =3D 1;               /* ignore cd */
> > >         comc_port->rtsdtr_off =3D 0;              /* rts-dtr is on */
> > >         comc_port->sio =3D NULL;
> > >
> > > was needed.  Possibly the following would be better:
> > >
> > > diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiser=
ialio.c
> > > index 8b3f8e83e0b3..54ee39096685 100644
> > > --- a/stand/efi/loader/efiserialio.c
> > > +++ b/stand/efi/loader/efiserialio.c
> > > @@ -494,8 +494,7 @@ comc_setup(void)
> > >                 return (false);
> > >
> > >         status =3D comc_port->sio->SetAttributes(comc_port->sio,
> > > -           comc_port->baudrate, 0, 0, comc_port->parity,
> > > -           comc_port->databits, comc_port->stopbits);
> > > +           0, 0, 0, 0, 0, 0);
> > >         if (EFI_ERROR(status))
> > >                 return (false);
> > >

--00000000000090433705f092be5b
Content-Type: text/plain; charset="US-ASCII"; name="stand.diff.txt"
Content-Disposition: attachment; filename="stand.diff.txt"
Content-Transfer-Encoding: base64
Content-ID: <f_lc1ywa5p0>
X-Attachment-Id: f_lc1ywa5p0

ZGlmZiAtLWdpdCBhL3N0YW5kL2VmaS9sb2FkZXIvTWFrZWZpbGUgYi9zdGFuZC9lZmkvbG9hZGVy
L01ha2VmaWxlCmluZGV4IDJhYWJhNGZiYjM3Ny4uNDQ4M2Y1MjRlNDNhIDEwMDY0NAotLS0gYS9z
dGFuZC9lZmkvbG9hZGVyL01ha2VmaWxlCisrKyBiL3N0YW5kL2VmaS9sb2FkZXIvTWFrZWZpbGUK
QEAgLTExNCw4ICsxMTQsOSBAQCAke0xPQURFUn0uZWZpOiAke1BST0d9CiAJZmkKIAlTT1VSQ0Vf
REFURV9FUE9DSD0ke1NPVVJDRV9EQVRFX0VQT0NIfSBcCiAJJHtPQkpDT1BZfSAtaiAucGVoZWFk
ZXIgLWogLnRleHQgLWogLnNkYXRhIC1qIC5kYXRhIFwKLQkJLWogLmR5bmFtaWMgLWogLmR5bnN5
bSAtaiAucmVsLmR5biBcCi0JCS1qIC5yZWxhLmR5biAtaiAucmVsb2MgLWogLmVoX2ZyYW1lIC1q
IHNldF9YY29tbWFuZF9zZXQgXAorCQktaiAuZHluYW1pYyAtaiAuZHluc3ltIC1qIC5keW5zdHIg
LWogLnJl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JLmFsaWduCTQK
--00000000000090433705f092be5b--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANtk6SjStgG4fR19ZCmK3SwMVCkTAP4q06zGj5ivdXASpjEFGg>