All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: PB1176 broken in -rc1
Date: Tue, 16 Aug 2011 10:59:36 +0100	[thread overview]
Message-ID: <20110816095936.GE28656@e102144-lin.cambridge.arm.com> (raw)
In-Reply-To: <CACRpkdbSG=Mnu7QrACn3y3GP-2H4_qT0kR_4C8umCmWc2YCqXQ@mail.gmail.com>

On Tue, Aug 16, 2011 at 10:35:08AM +0100, Linus Walleij wrote:
> Basically that's the realview_defconfig with these
> changes done on top:
> 
> scripts/config --file $(realview_dir)/.config \
>         --enable BLK_DEV_INITRD \
>         --set-str INITRAMFS_SOURCE rootfs-u338.cpio \
>         --enable INITRAMFS_COMPRESSION_NONE \
>         --enable MISC_DEVICES \
>         --enable ARM_CHARLCD \
>         --enable DEBUG_LL \
>         --enable EARLY_PRINTK \
>         --enable ARM_TEST \
>         --enable ARM_TCM_TEST \
>         --set-str CMDLINE "root=/dev/ram0 console=ttyAMA0 earlyprintk mem=128M"
>         yes "" | make $(make_options) oldconfig

The problem is with earlyprintk because your picking up multiple definitions
of DEBUG_LL_UART_OFFSET as a result of basing your config on the defconfig.

Take a look at arch/arm/mach-realview/include/mach/debug-macro.S. I don't
think there's an easy way to fix this because it's used so early, even DT
can't save us.

> > How do you use the interface
> > with the TCMs once they've been mapped at the high address?
> 
> Here is my test code patch I'm cooking RFC:
> 
> ------------8<-----------------------------8<-----------------------------
> From ece57aeca9a03107432c6090733f89f483872163 Mon Sep 17 00:00:00 2001
> From: Linus Walleij <linus.walleij@linaro.org>
> Date: Thu, 30 Jun 2011 14:33:48 +0200
> Subject: [PATCH] ARM TCM sample code
> 
> This is a simple sample snippet of ARM TCM code use, we create
> arm/test to host the code.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

[...]

> -static void __init test_tcm(void)
> -{
> -	u32 *tcmem;
> -	int i;
> -
> -	hello_tcm();
> -	printk("Hello TCM executed from ITCM RAM\n");
> -
> -	printk("TCM variable from testrun: %u @ %p\n", tcmvar, &tcmvar);
> -	tcmvar = 0xDEADBEEFU;
> -	printk("TCM variable: 0x%x @ %p\n", tcmvar, &tcmvar);
> -
> -	printk("TCM assigned variable: 0x%x @ %p\n", tcmassigned, &tcmassigned);
> -
> -	printk("TCM constant: 0x%x @ %p\n", tcmconst, &tcmconst);
> -
> -	/* Allocate some TCM memory from the pool */
> -	tcmem = tcm_alloc(20);
> -	if (tcmem) {
> -		printk("TCM Allocated 20 bytes of TCM @ %p\n", tcmem);
> -		tcmem[0] = 0xDEADBEEFU;
> -		tcmem[1] = 0x2BADBABEU;
> -		tcmem[2] = 0xCAFEBABEU;
> -		tcmem[3] = 0xDEADBEEFU;
> -		tcmem[4] = 0x2BADBABEU;

Hmm, do you need a barrier here to (a) stop the compiler constant folding
the tcm array and (b) force a read back from the TCM? Also, where does the
TCM sit in relation to the L1 cache (yes, I should RTFM...).

> -		for (i = 0; i < 5; i++)
> -			printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]);
> -		tcm_free(tcmem, 20);
> -	}
> -}

[...]

> +	if (tcmem) {
> +		pr_info("CPU: TCM Allocated 20 bytes of TCM @ %p\n", tcmem);
> +		tcmem[0] = CANARY1;
> +		tcmem[1] = CANARY2;
> +		tcmem[2] = CANARY3;
> +		tcmem[3] = CANARY1;
> +		tcmem[4] = CANARY2;

And again here?

> +		for (i = 0; i < 5; i++)
> +			pr_info("CPU: TCM tcmem[%d] = %08x\n", i, tcmem[i]);
> +		BUG_ON(tcmem[0] != CANARY1);
> +		BUG_ON(tcmem[1] != CANARY2);
> +		BUG_ON(tcmem[2] != CANARY3);
> +		BUG_ON(tcmem[3] != CANARY1);
> +		BUG_ON(tcmem[4] != CANARY2);
> +		tcm_free(tcmem, 20);
> +	}
> +	return 0;
> +}

Will

  reply	other threads:[~2011-08-16  9:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10 15:24 PB1176 broken in -rc1 Will Deacon
2011-08-10 15:39 ` Jamie Iles
2011-08-10 15:53   ` Will Deacon
2011-08-11 13:02     ` Linus Walleij
2011-08-11 14:05 ` Linus Walleij
2011-08-11 14:24   ` Will Deacon
2011-08-16  9:21 ` Linus Walleij
2011-08-16  9:26   ` Will Deacon
2011-08-16  9:35     ` Linus Walleij
2011-08-16  9:59       ` Will Deacon [this message]
2011-08-16 10:09         ` Russell King - ARM Linux
2011-08-16 10:17           ` Will Deacon
2011-08-16 11:34             ` Russell King - ARM Linux
2011-08-16 21:38               ` Will Deacon
2011-08-16 12:44         ` Linus Walleij
2011-08-16 12:52           ` Russell King - ARM Linux
2011-08-16  9:28   ` Jamie Iles
2011-08-16  9:50     ` Jamie Iles

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=20110816095936.GE28656@e102144-lin.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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.