All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Jackson <dan@thejacksons.uk>
To: Andreas Ziegler <br015@umbiko.net>
Cc: "buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] Adding USB support to existing device on 2.6.39.3 kernel - possible?
Date: Thu, 31 Mar 2022 06:19:37 +0000	[thread overview]
Message-ID: <AM6PR02MB4884198D3063202A4B1EA90EDAE19@AM6PR02MB4884.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <7a56c449ef38559922b9858eee8d1799@umbiko.net>



> -----Original Message-----
> From: Andreas Ziegler <br015@umbiko.net>
> Sent: 31 March 2022 06:58
> To: Dan Jackson <dan@thejacksons.uk>
> Cc: buildroot@buildroot.org
> Subject: Re: Adding USB support to existing device on 2.6.39.3 kernel -
> possible?
> 
> On 2022-03-30 19:18, Dan Jackson wrote:
> >> -----Original Message-----
> >> From: Andreas Ziegler <br015@umbiko.net>
> >> Sent: 30 March 2022 08:14
> >> To: Dan Jackson <dan@thejacksons.uk>
> >> Cc: buildroot@buildroot.org
> >> Subject: Re: Adding USB support to existing device on 2.6.39.3 kernel
> >> -
> >> possible?
> >>
> >> Hi Dan,
> >>
> >> cutting some old content.
> >>
> >> On 2022-03-29 19:19, Dan Jackson wrote:
> >>
> >> <cut>
> >>
> >> >> > However, now I have a new missing file error, and I can't seem
> >> >> > to locate a suitable candidate:
> >> >> >
> >> >> > In file included from
> >> >> > /home/danj/buildroot-2022.02/output/build/linux-
> >> >> custom/arch/arm/include/asm/system.h:165,
> >> >> >                  from
> >> >> > /home/danj/buildroot-2022.02/output/build/linux-
> >> >> custom/arch/arm/include/asm/bitops.h:27,
> >> >> >                  from include/linux/bitops.h:22,
> >> >> >                  from include/linux/kernel.h:17,
> >> >> >                  from include/linux/sched.h:55,
> >> >> >                  from arch/arm/kernel/asm-offsets.c:13:
> >> >> > /home/danj/buildroot-2022.02/output/build/linux-
> >> >> custom/arch/arm/include/asm/memory.h:19:10:
> >> >> > fatal error: mach/memory.h: No such file or directory
> >> >> >    19 | #include <mach/memory.h>
> >> >> >       |          ^~~~~~~~~~~~~~~
> >> >> > compilation terminated.
> >> >> > /home/danj/buildroot-2022.02/output/build/linux-
> custom/./Kbuild:81:
> >> >> > recipe for target 'arch/arm/kernel/asm-offsets.s' failed
> >> >> > make[3]: *** [arch/arm/kernel/asm-offsets.s] Error 1
> >> >> > Makefile:1009: recipe for target 'prepare0' failed
> >> >> > make[2]: *** [prepare0] Error 2
> >> >> > make[2]: *** Waiting for unfinished jobs....
> >> >> >   HOSTCC  scripts/mod/modpost.o
> >> >> >   HOSTCC  scripts/mod/sumversion.o
> >> >> >   HOSTLD  scripts/mod/modpost
> >> >> > make[2]: *** wait: No child processes. Stop.
> >> >> > package/pkg-generic.mk:289: recipe for target
> >> >> > '/home/danj/buildroot-2022.02/output/build/linux-
> >> custom/.stamp_built'
> >> >> > failed
> >> >> > make[1]: ***
> >> >> > [/home/danj/buildroot-2022.02/output/build/linux-
> custom/.stamp_b
> >> >> > uil
> >> >> > t]
> >> >> > Error 2
> >> >> > Makefile:84: recipe for target '_all' failed
> >> >> > make: *** [_all] Error 2
> >> >>
> >> >> This seems not to be the defconfig from above? It now uses
> >> >> linux-custom ...
> >> >> The failure may be due to the default kernel configuration. Try to
> >> >> configure the correct one and see if you get further.
> >> >>
> >> >> > I think maybe I am still doing something wrong because it sure
> >> >> > seems to be compiling a lot of stuff instead of letting me
> >> >> > configure
> >> things.
> >> >>
> >> >> It gets better once everything necessary is built.
> >> >
> >> > Still no luck I'm afraid. Same error with mach/memory.h as above.
> >> >
> >> > Buildroot defconfig now looks like this:
> >> >
> >> > BR2_armeb=y
> >> > BR2_STATIC_LIBS=y
> >> > BR2_KERNEL_HEADERS_VERSION=y
> >> > BR2_DEFAULT_KERNEL_VERSION="2.6.39.3"
> >> > BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD=y
> >> > BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
> >> > BR2_PTHREAD_DEBUG=y
> >> > BR2_BINUTILS_VERSION_2_37_X=y
> >> > BR2_GCC_VERSION_9_X=y
> >> > BR2_TOOLCHAIN_BUILDROOT_CXX=y
> >> > BR2_PACKAGE_HOST_GDB=y
> >> > BR2_GDB_VERSION_9_2=y
> >> > BR2_LINUX_KERNEL=y
> >> > BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> >> > BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="2.6.39.3"
> >> > BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> >> >
> >>
> BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="/home/danj/DG3270_9.1.103
> >> FB/sourcecode/ti_linux/linux-2.6.39.3/src/.config"
> >> > BR2_PACKAGE_DROPBEAR=y
> >> >
> >>
> BR2_PACKAGE_DROPBEAR_LOCALOPTIONS_FILE="/home/danj/localoptions
> >> .h"
> >> > BR2_PACKAGE_JOE=y
> >> >
> >> > I forgot to mention this before but the buildroot manual page you
> >> > mentioned said to create a local.mk file in order to use external
> >> > source, this looks like this:
> >> >
> >> > LINUX_OVERRIDE_SRCDIR =
> >> > /home/danj/DG3270_9.1.103FB/sourcecode/ti_linux/linux-2.6.39.3/src/
> >> >
> >> > For the kernel configuration I entered the kernel source dir and
> >> > did "make menuconfig", I left everything at the defaults except for
> >> > enabling the USB related items.
> >> >
> >> > The resulting configuration file is attached as a text file.
> >> > Unfortunately it's been literally decades since I last actually
> >> > compiled a kernel, so I'm afraid I have no idea what bits would be
> >> > suitable to disable/remove to get the results I want (I'm guessing
> >> > this will be the most likely way to eliminate the error I'm
> >> > getting?)
> >>
> >> I did a compile test this morning, the Buildroot version was some
> >> early
> >> 2022.02 version, not up-to-date.
> >>
> >> You have a potential header mismatch, Select Toolchain -> Kernel
> >> Headers
> >> -> Same as kernel being built to use the vendor source also for the
> >> headers.
> >>
> >> I could configure Linux with make menuconfig, did not encounter the
> >> missing memory.h error above, but the build stops during Linux kernel
> >> compilation with this error:
> >>
> >> /tmp/ccSO8f6S.s: Assembler messages:
> >> /tmp/ccSO8f6S.s:950: Error: .err encountered
> >> make[3]: *** [scripts/Makefile.build:284:
> >> arch/arm/kernel/sys_oabi-compat.o] Error 1
> >> make[2]: *** [Makefile:969: arch/arm/kernel] Error 2
> >> make[1]: *** [package/pkg-generic.mk:292:
> >> /home/data/test/buildroot/output/build/linux-custom/.stamp_built]
> >> Error
> >> 2
> >> make: *** [Makefile:84: _all] Error 2
> >>
> >> Full error log is here: https://pastebin.com/VrXqSVsD
> >
> > Looking at the error log, it seems like vfp has been selected? But my
> > target device only has Features: swp half thumb fastmult edsp java.
> 
> This is just a warning, I would ignore it at this point in time.
> Compiler syntax checks tend to get more strict over time ...
> 
> > Also, OABI does not seem like it is the correct ABI. For example, if I
> > run "file" against the busybox binary the device comes with, I get:
> >
> > busybox: ELF 32-bit MSB executable, ARM, EABI5 version 1 (SYSV),
> > dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped
> 
> It seems to be a compatibility layer for legacy software; disabling
> OABI_COMPAT is an option, because you probably will never need it.
> 
> I used the source tree and unmodified .config contained in the Touchstone
> DG3270 Cable Gateway project on SourceForge for the test.
> 
> The original build instructions seem to indicate that more software is needed
> to build the device firmware. This might be the reason for missing files ...
> 
> Also, take a look at psp_drivers.Kconfig for the options necessary to enable
> USB support.

It's starting to seem like it might be a better option to try to get the original software development kit to work instead of trying to use its components with modern buildroot.

Ironically the SDK is itself based on ancient buildroot - in /proc/version on the target device I can see:

(gcc version 4.7.3 (Buildroot 2013.08.1) )

> 
> >>
> >> You might now do some research:
> >>
> >> https://stackoverflow.com/questions/61235299/gcc-8-3-arm-assembly-
> >> error-when-building-linux-kernel-3-14-17-in-buildroot-2020
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
> >>
> >> or try to switch to an older compiler ...
> >>
> >> --
> >> Andreas
> >>
> >> <cut>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-03-31  6:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.22068.1648533484.192135.buildroot@buildroot.org>
2022-03-29  9:40 ` [Buildroot] Adding USB support to existing device on 2.6.39.3 kernel - possible? Andreas Ziegler
2022-03-29 12:48   ` Dan Jackson
2022-03-29 15:13     ` Andreas Ziegler
2022-03-29 16:17       ` Dan Jackson
2022-03-29 17:52         ` Andreas Ziegler
2022-03-29 19:19           ` Dan Jackson
2022-03-30  7:13             ` Andreas Ziegler
2022-03-30 19:18               ` Dan Jackson
2022-03-31  5:57                 ` Andreas Ziegler
2022-03-31  6:19                   ` Dan Jackson [this message]
2022-03-31  6:50                     ` Andreas Ziegler
2022-03-29  5:57 Dan Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR02MB4884198D3063202A4B1EA90EDAE19@AM6PR02MB4884.eurprd02.prod.outlook.com \
    --to=dan@thejacksons.uk \
    --cc=br015@umbiko.net \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.