Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp574700pxb; Wed, 22 Sep 2021 08:26:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuMKHDYoifuDLzQbuD66+Yb3wwAjlnWIl4JgiTdCa43L6u4k66C4alVwXMlnS+XL2H2Pid X-Received: by 2002:a6b:b242:: with SMTP id b63mr137810iof.133.1632324394382; Wed, 22 Sep 2021 08:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632324394; cv=none; d=google.com; s=arc-20160816; b=RHR6zr6kpXB87d2VXgYJlcpmSQ6VB7DtcfPj6ywMM6PjlpLz5s+r0lJEF1zo4a5rYe O08Py/UDJA1nFxRn5iglB8hEpCmY5sF6STobKOPDOiY2qfSkERWgya/eZBPe1m5DydAX /pdYvJghwJo12Kqy8+3KLNMuGB70o4/Cu663SQH/i+n8gcHbljnaL2CN+JVbSvFHqs4G AAaFhaiKWKUd7kblJUak00rMbFFY9BZH02q+rA3b1wRqjOFihFx/Rw2I4Sc5xAfiPnoH xwtGsBFkanoEIEnXDof3rCRR3PVwxlvKv8ahtOCCtDEen8pKKk2vZbj+IFPgL7uVA2YF +uYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=qoUCKun9GOqpNGoTy8WaehZ/oDjPVJ/YWHnCEdsLlKI=; b=J3PZomsQGwipGMoiJKuL0rw4q+qmAkZVrn9pu/GvPR/9wrRniyjAeFPsX5W0mOmt8c K/2+VLVZy1Gpu/0qow3JEdMokWfq7HX7kAuvpAdzDqNs1UEjTxbMdO/wAfTMzC5X+w2z dM+EH7Q85d5fSlSWj/LoZ9haHVJTr+rMKXdURljy0oVp4Q7RxGBmUCFFMcH0k2Ih3jQt Ewn1V8hL2Rt1/aaeYZr3nvsVmF/vRCZi4n3VjTtSYNYBzRG36QRNmaEHKGL8rNkEB6i9 jnTE87ro2ZRgAc2YNFCxRi0H4QUp2t7EnAmc5PrbxDYL05pQaYGasvTMW80fir43YD1y 17yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NCFHxJkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si2787600ilo.83.2021.09.22.08.26.21; Wed, 22 Sep 2021 08:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NCFHxJkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236395AbhIVPZ6 (ORCPT + 99 others); Wed, 22 Sep 2021 11:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbhIVPZ5 (ORCPT ); Wed, 22 Sep 2021 11:25:57 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A53C061574 for ; Wed, 22 Sep 2021 08:24:27 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id k23so2355291pji.0 for ; Wed, 22 Sep 2021 08:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=qoUCKun9GOqpNGoTy8WaehZ/oDjPVJ/YWHnCEdsLlKI=; b=NCFHxJkJaSuc8ezfgccDGxy89T4yLV+mnMNf8zxTD2Vxzx53ifSv4bdZAUNQp3IZrg JW9s4Q5ei2MKlMrNQl0FEzbPHA8+VeL5fuzup08ErGEJ0hKGilqBJ8jnncP85TaAPtJR GZCb95Zz9M96jRusGMJZV8PQMyOxFu10+Y1yzgKG+fjyfwAmyDkL2K2Z74Eo63rpl1tk tSuSpinobM7L/iZSDR2fRsoU84osWIm5qw469xUuZgwG2f4yw6riC6r1JyXHEX98DtRD oVikUXc9ALSImcZvxmtHc79w+VE2CURQeXbaZLLLF9tNExduoK+Rx6GzyPgeUV8SMKM+ Dr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qoUCKun9GOqpNGoTy8WaehZ/oDjPVJ/YWHnCEdsLlKI=; b=nbwc/P4mpdP+GC5QaUL3GYw25kJIk1YRJt100/oJsCjM/Mt6CI+/uSKKLaxt2DoNoB VPGRiSgQK9KIvV/3zh2rbvvBUtWRDLBYeTTTxdKk4fj5ilP+RMfccTB1s1UCFIhfuXuP gJCv7kBYud/EXBvkRu1xly0man2eu7LhrRYJ+HaqipVyjf7297RQ9Pwu7wO/JKEjcFyi 7HWTrsIVlYS7ZCx8GQ7GceFbm0YZElHOu20NONCSiIlskrJDOBcdeJN5Gr/MHMOjR8Qe WY3ZcrSI+6pumHZDFRiAXg+GltMuhUZAyO0zShG7elDnZsyTWkTXmEHGiyTsh5BootTc SVHQ== X-Gm-Message-State: AOAM530s781vTfUT9wYPI5r1Q5G63RrZYKyHKa0fRFfnHmcgHvPdRxfP IQrlmnngmqO3qTJgJtyltXij1ju4tdp+6aO9onu67A32dCc= X-Received: by 2002:a17:90a:191a:: with SMTP id 26mr35644pjg.79.1632324266800; Wed, 22 Sep 2021 08:24:26 -0700 (PDT) MIME-Version: 1.0 From: cp Date: Wed, 22 Sep 2021 17:24:30 +0200 Message-ID: Subject: Linux PowerPC 4xx doesn't boot when linkaddr=0x0090.0000 To: Linux-Kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi I am new to this list. Hope this is the right place to ask. I am working with a PPC405GP board, and as far as I understand, the support for ppc40x platforms like Acadia and Walnut were dropped with kernel 5.8.0, so this seems like a pretty straightforward question, but extensive experiments from kernel 4.11 to kernel 5.7.19 haven't shown a really clear, up-to-date answer. In k4.11 .. k5.7.19, when the kernel size is bigger than 8 MB, the final kernel doesn't boot but rather arch/powerpc/boot/main.c dies before the first message from the kernel shows up. Why? Digging deeper I see the relation between the kernel size and link_addr # Round the size to next higher MB limit round_size=$(((strip_size + 0xfffff) & 0xfff00000)) round_size=0x$(printf "%x" $round_size) link_addr=$(printf "%d" $link_address) and this is where link_addr is involved text_start="-Ttext $link_address" My kernels are compiled for cuboot, and the code that invokes "kentry" is entirely located in arch/powerpc/boot/main.c I instrumned that module, and this is what I see on the condole The following is the same kernel, compiled with the same .config, but with two link_addr values A) with link_addr=0x0080.0000 image loaded from 0x00800000 SP=0x03eb1b80 kernel_size = 7411084 bytes copying 256 bytes from kernel-image at 0x0080f000 to elfheader elf_info.loadsize = 0x00700e68 elf_info.memsize = 0x0074234c allocating 7611212 bytes for the new kernel copying ... from = 0x0081f000 to = 0x00000000 size = 7343720 flush_cache, 32Mbyte flushed cmdline: uboot bootargs overridden cmdline=[console=ttyS0,115200 root=/dev/sda2 rootfstype=ext2 rw init=/sbin/init ] Finalizing device tree... flat tree at 0xf23b80 ft_addr=0xf23b80 my tp1: success kernel booting .... (it boots) B) with link_addr=0x0080.0000 image loaded from 0x00900000 SP=0x03eb1b80 kernel_size = 7411084 copying 256 bytes from kernel-image at 0x0090f000 to elfheader elf_info.loadsize = 0x00700e68 elf_info.memsize = 0x0074234c allocating 7611212 bytes for the new kernel copying ... from = 0x0091f000 to = 0x00000000 size = 7343720 flush_cache, 32Mbyte flushed cmdline: uboot bootargs overridden cmdline=[console=ttyS0,115200 root=/dev/sda2 rootfstype=ext2 rw init=/sbin/init ] Finalizing device tree... flat tree at 0x1023b80 ft_addr=0x1023b80 my tp2: success my tp3: success invalidate_cache 0x00000000+0x02000000 my tp4: (point of no return) calling kentry()... kernel booting .... (it dies at this point, but without a debugger it's like watching something fall into a black hole) Any ideas? I am lost ... Carlo