All of lore.kernel.org
 help / color / mirror / Atom feed
* Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-18 20:44 ` Jan Siegmund
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-18 20:44 UTC (permalink / raw)
  To: u-boot; +Cc: Anatolij Gustschin, linux-fpga, marex

Hi all,
Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
Is is possible to configure the the interface in U-Boot or SPL,
without reprogramming the FPGA? Maybe through the usage of the generated
header files from the Quartus synthesis?
The SDRAM controller's registers only differ in eight entries in Linux when the
FPGA is programmed or not.

+----------+-------------+------------+----------------+
| address  |    name     | programmed | not programmed |
+----------+-------------+------------+----------------+
| FFC25064 |             | 00044003   | 00044FFF       |
| FFC25068 |             | 2C000000   | 2C03FFFF       |
| FFC2506c |             | 00B00000   | 00B3FFFF       |
| FFC25070 |             | 00760000   | 0076FFFF       |
| FFC25074 |             | 00980000   | 0098FFFF       |
| FFC25078 |             | 0005A003   | 0005AFFF       |
| FFC2507c | portcfg     | 00000000   | 0000003F       |
| FFC25080 | fpgaportrst | 000001FF   | 00000000       |
+----------+-------------+------------+----------------+

The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
[1], so are they even intended to be configured?

Thanks



[1]
https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-18 20:44 ` Jan Siegmund
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-18 20:44 UTC (permalink / raw)
  To: u-boot

Hi all,
Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
Is is possible to configure the the interface in U-Boot or SPL,
without reprogramming the FPGA? Maybe through the usage of the generated
header files from the Quartus synthesis?
The SDRAM controller's registers only differ in eight entries in Linux when the
FPGA is programmed or not.

+----------+-------------+------------+----------------+
| address  |    name     | programmed | not programmed |
+----------+-------------+------------+----------------+
| FFC25064 |             | 00044003   | 00044FFF       |
| FFC25068 |             | 2C000000   | 2C03FFFF       |
| FFC2506c |             | 00B00000   | 00B3FFFF       |
| FFC25070 |             | 00760000   | 0076FFFF       |
| FFC25074 |             | 00980000   | 0098FFFF       |
| FFC25078 |             | 0005A003   | 0005AFFF       |
| FFC2507c | portcfg     | 00000000   | 0000003F       |
| FFC25080 | fpgaportrst | 000001FF   | 00000000       |
+----------+-------------+------------+----------------+

The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
[1], so are they even intended to be configured?

Thanks



[1]
https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
  2017-12-18 20:44 ` [U-Boot] " Jan Siegmund
@ 2017-12-18 21:05   ` Marek Vasut
  -1 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-18 21:05 UTC (permalink / raw)
  To: Jan Siegmund, u-boot; +Cc: Anatolij Gustschin, linux-fpga

On 12/18/2017 09:44 PM, Jan Siegmund wrote:
> Hi all,

Hi,

> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
> Is is possible to configure the the interface in U-Boot or SPL,

What is "the interface" ?

If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
at all. They just configure the IOMUX/clock rings, but that's all.

> without reprogramming the FPGA? Maybe through the usage of the generated
> header files from the Quartus synthesis?
> The SDRAM controller's registers only differ in eight entries in Linux when the
> FPGA is programmed or not.
> 
> +----------+-------------+------------+----------------+
> | address  |    name     | programmed | not programmed |
> +----------+-------------+------------+----------------+
> | FFC25064 |             | 00044003   | 00044FFF       |
> | FFC25068 |             | 2C000000   | 2C03FFFF       |
> | FFC2506c |             | 00B00000   | 00B3FFFF       |
> | FFC25070 |             | 00760000   | 0076FFFF       |
> | FFC25074 |             | 00980000   | 0098FFFF       |
> | FFC25078 |             | 0005A003   | 0005AFFF       |
> | FFC2507c | portcfg     | 00000000   | 0000003F       |
> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
> +----------+-------------+------------+----------------+
> 
> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
> [1], so are they even intended to be configured?
> 
> Thanks
> 
> 
> 
> [1]
> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-18 21:05   ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-18 21:05 UTC (permalink / raw)
  To: u-boot

On 12/18/2017 09:44 PM, Jan Siegmund wrote:
> Hi all,

Hi,

> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
> Is is possible to configure the the interface in U-Boot or SPL,

What is "the interface" ?

If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
at all. They just configure the IOMUX/clock rings, but that's all.

> without reprogramming the FPGA? Maybe through the usage of the generated
> header files from the Quartus synthesis?
> The SDRAM controller's registers only differ in eight entries in Linux when the
> FPGA is programmed or not.
> 
> +----------+-------------+------------+----------------+
> | address  |    name     | programmed | not programmed |
> +----------+-------------+------------+----------------+
> | FFC25064 |             | 00044003   | 00044FFF       |
> | FFC25068 |             | 2C000000   | 2C03FFFF       |
> | FFC2506c |             | 00B00000   | 00B3FFFF       |
> | FFC25070 |             | 00760000   | 0076FFFF       |
> | FFC25074 |             | 00980000   | 0098FFFF       |
> | FFC25078 |             | 0005A003   | 0005AFFF       |
> | FFC2507c | portcfg     | 00000000   | 0000003F       |
> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
> +----------+-------------+------------+----------------+
> 
> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
> [1], so are they even intended to be configured?
> 
> Thanks
> 
> 
> 
> [1]
> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
  2017-12-18 21:05   ` [U-Boot] " Marek Vasut
@ 2017-12-19 23:29     ` Jan Siegmund
  -1 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-19 23:29 UTC (permalink / raw)
  To: Marek Vasut, u-boot; +Cc: Anatolij Gustschin, linux-fpga

Am 18.12.2017 um 22:05 schrieb Marek Vasut:
> On 12/18/2017 09:44 PM, Jan Siegmund wrote:

Hi Marek,

>> Hi all,
> 
> Hi,
> 
>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>> Is is possible to configure the the interface in U-Boot or SPL,
> 
> What is "the interface" ?

I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
[2], sometimes called FPGA2SDRAM bridge.

> 
> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
> at all. They just configure the IOMUX/clock rings, but that's all.
> 

I know the FPGA is not configured in SPL, but does the FPGA need to be
configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface? Would it be
possible to just preset the registers for later configuration?
My preferred usecase would be configuring the registers in the table below in
SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
interface.

For example, the last bits in the portcfg register define whether the
FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
this register can't be written to in U-Boot, even though it is specified as rw
[3]. Can this register just be set by programming the FPGA?

>> without reprogramming the FPGA? Maybe through the usage of the generated
>> header files from the Quartus synthesis?
>> The SDRAM controller's registers only differ in eight entries in Linux when the
>> FPGA is programmed or not.
>>
>> +----------+-------------+------------+----------------+
>> | address  |    name     | programmed | not programmed |
>> +----------+-------------+------------+----------------+
>> | FFC25064 |             | 00044003   | 00044FFF       |
>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>> | FFC25070 |             | 00760000   | 0076FFFF       |
>> | FFC25074 |             | 00980000   | 0098FFFF       |
>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>> +----------+-------------+------------+----------------+
>>
>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>> [1], so are they even intended to be configured?
>>
>> Thanks
>>
>>
>>
>> [1]
>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>
> 
> 

Best regards,
Jan

[2]
https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001


[3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-19 23:29     ` Jan Siegmund
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-19 23:29 UTC (permalink / raw)
  To: u-boot

Am 18.12.2017 um 22:05 schrieb Marek Vasut:
> On 12/18/2017 09:44 PM, Jan Siegmund wrote:

Hi Marek,

>> Hi all,
> 
> Hi,
> 
>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>> Is is possible to configure the the interface in U-Boot or SPL,
> 
> What is "the interface" ?

I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
[2], sometimes called FPGA2SDRAM bridge.

> 
> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
> at all. They just configure the IOMUX/clock rings, but that's all.
> 

I know the FPGA is not configured in SPL, but does the FPGA need to be
configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface? Would it be
possible to just preset the registers for later configuration?
My preferred usecase would be configuring the registers in the table below in
SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
interface.

For example, the last bits in the portcfg register define whether the
FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
this register can't be written to in U-Boot, even though it is specified as rw
[3]. Can this register just be set by programming the FPGA?

>> without reprogramming the FPGA? Maybe through the usage of the generated
>> header files from the Quartus synthesis?
>> The SDRAM controller's registers only differ in eight entries in Linux when the
>> FPGA is programmed or not.
>>
>> +----------+-------------+------------+----------------+
>> | address  |    name     | programmed | not programmed |
>> +----------+-------------+------------+----------------+
>> | FFC25064 |             | 00044003   | 00044FFF       |
>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>> | FFC25070 |             | 00760000   | 0076FFFF       |
>> | FFC25074 |             | 00980000   | 0098FFFF       |
>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>> +----------+-------------+------------+----------------+
>>
>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>> [1], so are they even intended to be configured?
>>
>> Thanks
>>
>>
>>
>> [1]
>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>
> 
> 

Best regards,
Jan

[2]
https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001


[3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
  2017-12-19 23:29     ` [U-Boot] " Jan Siegmund
@ 2017-12-20  9:35       ` Marek Vasut
  -1 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-20  9:35 UTC (permalink / raw)
  To: Jan Siegmund, u-boot; +Cc: Anatolij Gustschin, linux-fpga

On 12/20/2017 12:29 AM, Jan Siegmund wrote:
> Am 18.12.2017 um 22:05 schrieb Marek Vasut:
>> On 12/18/2017 09:44 PM, Jan Siegmund wrote:
> 
> Hi Marek,

Hi,

>>> Hi all,
>>
>> Hi,
>>
>>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>>> Is is possible to configure the the interface in U-Boot or SPL,
>>
>> What is "the interface" ?
> 
> I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
> [2], sometimes called FPGA2SDRAM bridge.

Oh OK. The F2S bridge is a bit special indeed.

>> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
>> at all. They just configure the IOMUX/clock rings, but that's all.
>>
> 
> I know the FPGA is not configured in SPL, but does the FPGA need to be
> configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface?

No

> Would it be
> possible to just preset the registers for later configuration?

Yes

> My preferred usecase would be configuring the registers in the table below in
> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
> interface.
> 
> For example, the last bits in the portcfg register define whether the
> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
> this register can't be written to in U-Boot, even though it is specified as rw
> [3]. Can this register just be set by programming the FPGA?

You might need to regenerate the SPL if you changed those kinds of
settings. The SPL programs these based on the handoff files IIRC.

>>> without reprogramming the FPGA? Maybe through the usage of the generated
>>> header files from the Quartus synthesis?
>>> The SDRAM controller's registers only differ in eight entries in Linux when the
>>> FPGA is programmed or not.
>>>
>>> +----------+-------------+------------+----------------+
>>> | address  |    name     | programmed | not programmed |
>>> +----------+-------------+------------+----------------+
>>> | FFC25064 |             | 00044003   | 00044FFF       |
>>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>>> | FFC25070 |             | 00760000   | 0076FFFF       |
>>> | FFC25074 |             | 00980000   | 0098FFFF       |
>>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>>> +----------+-------------+------------+----------------+
>>>
>>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>>> [1], so are they even intended to be configured?
>>>
>>> Thanks
>>>
>>>
>>>
>>> [1]
>>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>>
>>
>>
> 
> Best regards,
> Jan
> 
> [2]
> https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001
> 
> 
> [3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-20  9:35       ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-20  9:35 UTC (permalink / raw)
  To: u-boot

On 12/20/2017 12:29 AM, Jan Siegmund wrote:
> Am 18.12.2017 um 22:05 schrieb Marek Vasut:
>> On 12/18/2017 09:44 PM, Jan Siegmund wrote:
> 
> Hi Marek,

Hi,

>>> Hi all,
>>
>> Hi,
>>
>>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>>> Is is possible to configure the the interface in U-Boot or SPL,
>>
>> What is "the interface" ?
> 
> I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
> [2], sometimes called FPGA2SDRAM bridge.

Oh OK. The F2S bridge is a bit special indeed.

>> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
>> at all. They just configure the IOMUX/clock rings, but that's all.
>>
> 
> I know the FPGA is not configured in SPL, but does the FPGA need to be
> configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface?

No

> Would it be
> possible to just preset the registers for later configuration?

Yes

> My preferred usecase would be configuring the registers in the table below in
> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
> interface.
> 
> For example, the last bits in the portcfg register define whether the
> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
> this register can't be written to in U-Boot, even though it is specified as rw
> [3]. Can this register just be set by programming the FPGA?

You might need to regenerate the SPL if you changed those kinds of
settings. The SPL programs these based on the handoff files IIRC.

>>> without reprogramming the FPGA? Maybe through the usage of the generated
>>> header files from the Quartus synthesis?
>>> The SDRAM controller's registers only differ in eight entries in Linux when the
>>> FPGA is programmed or not.
>>>
>>> +----------+-------------+------------+----------------+
>>> | address  |    name     | programmed | not programmed |
>>> +----------+-------------+------------+----------------+
>>> | FFC25064 |             | 00044003   | 00044FFF       |
>>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>>> | FFC25070 |             | 00760000   | 0076FFFF       |
>>> | FFC25074 |             | 00980000   | 0098FFFF       |
>>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>>> +----------+-------------+------------+----------------+
>>>
>>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>>> [1], so are they even intended to be configured?
>>>
>>> Thanks
>>>
>>>
>>>
>>> [1]
>>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>>
>>
>>
> 
> Best regards,
> Jan
> 
> [2]
> https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001
> 
> 
> [3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
  2017-12-20  9:35       ` [U-Boot] " Marek Vasut
@ 2017-12-20 11:51         ` Jan Siegmund
  -1 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-20 11:51 UTC (permalink / raw)
  To: Marek Vasut, u-boot; +Cc: Anatolij Gustschin, linux-fpga

Am 20.12.2017 um 10:35 schrieb Marek Vasut:
> On 12/20/2017 12:29 AM, Jan Siegmund wrote:
>> Am 18.12.2017 um 22:05 schrieb Marek Vasut:
>>> On 12/18/2017 09:44 PM, Jan Siegmund wrote:
>>
>> Hi Marek,
> 
> Hi,
> 

Hi Marek,

>>>> Hi all,
>>>
>>> Hi,
>>>
>>>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>>>> Is is possible to configure the the interface in U-Boot or SPL,
>>>
>>> What is "the interface" ?
>>
>> I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
>> [2], sometimes called FPGA2SDRAM bridge.
> 
> Oh OK. The F2S bridge is a bit special indeed.
> 
>>> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
>>> at all. They just configure the IOMUX/clock rings, but that's all.
>>>
>>
>> I know the FPGA is not configured in SPL, but does the FPGA need to be
>> configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface?
> 
> No
> 
>> Would it be
>> possible to just preset the registers for later configuration?
> 
> Yes
> 
>> My preferred usecase would be configuring the registers in the table below in
>> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
>> interface.
>>
>> For example, the last bits in the portcfg register define whether the
>> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
>> this register can't be written to in U-Boot, even though it is specified as rw
>> [3]. Can this register just be set by programming the FPGA?
> 
> You might need to regenerate the SPL if you changed those kinds of
> settings. The SPL programs these based on the handoff files IIRC.

I generated the headers using the bsp-editor from Quartus 17 and converted them
using the qts-filter.sh script in U-Boot. Since then, I did not change any settings.

sdram.h in board/.../qts and mach-socfpga/

	#define CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN	0

	#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB		10

wrap_sdram_config.c
	.port_cfg =
		(CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN <<
			SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB),

sdram.c
	debug("Configuring PORTCFG\n");
	writel(cfg->port_cfg, &sdr_ctrl->port_cfg);

When I add some debug printing around the code shown above, SPL console shows this:

U-Boot SPL 2018.01-rc1-00129-ga8548b9-dirty (Dec 18 2017 - 14:13:21)
Content of ffc2507c is 3f
Wrote 0 to ffc2507c
Content of ffc2507c is 3f
drivers/ddr/altera/sequencer.c: Preparing to start memory calibration
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1

Maybe the portprotocol part of portcfg is just a status register. But then
again, why would it be specified as rw?

Do you have any idea what I might be missing, to get the f2s running without
programming the FPGA?

> 
>>>> without reprogramming the FPGA? Maybe through the usage of the generated
>>>> header files from the Quartus synthesis?
>>>> The SDRAM controller's registers only differ in eight entries in Linux when the
>>>> FPGA is programmed or not.
>>>>
>>>> +----------+-------------+------------+----------------+
>>>> | address  |    name     | programmed | not programmed |
>>>> +----------+-------------+------------+----------------+
>>>> | FFC25064 |             | 00044003   | 00044FFF       |
>>>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>>>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>>>> | FFC25070 |             | 00760000   | 0076FFFF       |
>>>> | FFC25074 |             | 00980000   | 0098FFFF       |
>>>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>>>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>>>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>>>> +----------+-------------+------------+----------------+
>>>>
>>>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>>>> [1], so are they even intended to be configured?
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> [1]
>>>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>>>
>>>
>>>
>>
>> Best regards,
>> Jan
>>
>> [2]
>> https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001
>>
>>
>> [3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html
>>
> 
> 

Best regards,
Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-20 11:51         ` Jan Siegmund
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Siegmund @ 2017-12-20 11:51 UTC (permalink / raw)
  To: u-boot

Am 20.12.2017 um 10:35 schrieb Marek Vasut:
> On 12/20/2017 12:29 AM, Jan Siegmund wrote:
>> Am 18.12.2017 um 22:05 schrieb Marek Vasut:
>>> On 12/18/2017 09:44 PM, Jan Siegmund wrote:
>>
>> Hi Marek,
> 
> Hi,
> 

Hi Marek,

>>>> Hi all,
>>>
>>> Hi,
>>>
>>>> Here is another question on the FPGA to SDRAM interface of the Cyclone V SoC.
>>>> Is is possible to configure the the interface in U-Boot or SPL,
>>>
>>> What is "the interface" ?
>>
>> I am sorry I did not specify it further. I meant the FPGA-to-HPS SDRAM interface
>> [2], sometimes called FPGA2SDRAM bridge.
> 
> Oh OK. The F2S bridge is a bit special indeed.
> 
>>> If you mean DRAM, then yes, the CV/AV do _not_ configure the FPGA in SPL
>>> at all. They just configure the IOMUX/clock rings, but that's all.
>>>
>>
>> I know the FPGA is not configured in SPL, but does the FPGA need to be
>> configured in SPL or U-Boot, to use the FPGA-to-HPS SDRAM interface?
> 
> No
> 
>> Would it be
>> possible to just preset the registers for later configuration?
> 
> Yes
> 
>> My preferred usecase would be configuring the registers in the table below in
>> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
>> interface.
>>
>> For example, the last bits in the portcfg register define whether the
>> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
>> this register can't be written to in U-Boot, even though it is specified as rw
>> [3]. Can this register just be set by programming the FPGA?
> 
> You might need to regenerate the SPL if you changed those kinds of
> settings. The SPL programs these based on the handoff files IIRC.

I generated the headers using the bsp-editor from Quartus 17 and converted them
using the qts-filter.sh script in U-Boot. Since then, I did not change any settings.

sdram.h in board/.../qts and mach-socfpga/

	#define CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN	0

	#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB		10

wrap_sdram_config.c
	.port_cfg =
		(CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN <<
			SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB),

sdram.c
	debug("Configuring PORTCFG\n");
	writel(cfg->port_cfg, &sdr_ctrl->port_cfg);

When I add some debug printing around the code shown above, SPL console shows this:

U-Boot SPL 2018.01-rc1-00129-ga8548b9-dirty (Dec 18 2017 - 14:13:21)
Content of ffc2507c is 3f
Wrote 0 to ffc2507c
Content of ffc2507c is 3f
drivers/ddr/altera/sequencer.c: Preparing to start memory calibration
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1

Maybe the portprotocol part of portcfg is just a status register. But then
again, why would it be specified as rw?

Do you have any idea what I might be missing, to get the f2s running without
programming the FPGA?

> 
>>>> without reprogramming the FPGA? Maybe through the usage of the generated
>>>> header files from the Quartus synthesis?
>>>> The SDRAM controller's registers only differ in eight entries in Linux when the
>>>> FPGA is programmed or not.
>>>>
>>>> +----------+-------------+------------+----------------+
>>>> | address  |    name     | programmed | not programmed |
>>>> +----------+-------------+------------+----------------+
>>>> | FFC25064 |             | 00044003   | 00044FFF       |
>>>> | FFC25068 |             | 2C000000   | 2C03FFFF       |
>>>> | FFC2506c |             | 00B00000   | 00B3FFFF       |
>>>> | FFC25070 |             | 00760000   | 0076FFFF       |
>>>> | FFC25074 |             | 00980000   | 0098FFFF       |
>>>> | FFC25078 |             | 0005A003   | 0005AFFF       |
>>>> | FFC2507c | portcfg     | 00000000   | 0000003F       |
>>>> | FFC25080 | fpgaportrst | 000001FF   | 00000000       |
>>>> +----------+-------------+------------+----------------+
>>>>
>>>> The registers 0xFFC25064-0xFFC25078 don't show up on the HPS' memory map
>>>> [1], so are they even intended to be configured?
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> [1]
>>>> https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577380716.html#sfo1411577380716
>>>>
>>>
>>>
>>
>> Best regards,
>> Jan
>>
>> [2]
>> https://www.altera.com/documentation/sfo1410143707420.html#sfo1411577336440__section_N10012_N1000F_N10001
>>
>>
>> [3] https://www.altera.com/hps/cyclone-v/hps.html#topic/sfo1411577375739.html
>>
> 
> 

Best regards,
Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
  2017-12-20 11:51         ` [U-Boot] " Jan Siegmund
@ 2017-12-20 15:06           ` Marek Vasut
  -1 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-20 15:06 UTC (permalink / raw)
  To: Jan Siegmund, u-boot
  Cc: Anatolij Gustschin, linux-fpga, Dinh Nguyen, See, Chin Liang

On 12/20/2017 12:51 PM, Jan Siegmund wrote:
[...]
>>> My preferred usecase would be configuring the registers in the table below in
>>> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
>>> interface.
>>>
>>> For example, the last bits in the portcfg register define whether the
>>> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
>>> this register can't be written to in U-Boot, even though it is specified as rw
>>> [3]. Can this register just be set by programming the FPGA?
>>
>> You might need to regenerate the SPL if you changed those kinds of
>> settings. The SPL programs these based on the handoff files IIRC.
> 
> I generated the headers using the bsp-editor from Quartus 17 and converted them
> using the qts-filter.sh script in U-Boot. Since then, I did not change any settings.
> 
> sdram.h in board/.../qts and mach-socfpga/
> 
> 	#define CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN	0
> 
> 	#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB		10
> 
> wrap_sdram_config.c
> 	.port_cfg =
> 		(CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN <<
> 			SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB),
> 
> sdram.c
> 	debug("Configuring PORTCFG\n");
> 	writel(cfg->port_cfg, &sdr_ctrl->port_cfg);
> 
> When I add some debug printing around the code shown above, SPL console shows this:
> 
> U-Boot SPL 2018.01-rc1-00129-ga8548b9-dirty (Dec 18 2017 - 14:13:21)
> Content of ffc2507c is 3f
> Wrote 0 to ffc2507c
> Content of ffc2507c is 3f
> drivers/ddr/altera/sequencer.c: Preparing to start memory calibration
> drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
> drivers/ddr/altera/sequencer.c: Calibration complete
> Trying to boot from MMC1
> 
> Maybe the portprotocol part of portcfg is just a status register. But then
> again, why would it be specified as rw?

It should be RW actually.

> Do you have any idea what I might be missing, to get the f2s running without
> programming the FPGA?
CCing Dinh and Chin.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA
@ 2017-12-20 15:06           ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2017-12-20 15:06 UTC (permalink / raw)
  To: u-boot

On 12/20/2017 12:51 PM, Jan Siegmund wrote:
[...]
>>> My preferred usecase would be configuring the registers in the table below in
>>> SPL and configuring the FPGA in Linux, with a design using the FPGA-to-HPS SDRAM
>>> interface.
>>>
>>> For example, the last bits in the portcfg register define whether the
>>> FPGA-to-HPS SDRAM interface's protocol is AXI or Avalon MM. The problem is, that
>>> this register can't be written to in U-Boot, even though it is specified as rw
>>> [3]. Can this register just be set by programming the FPGA?
>>
>> You might need to regenerate the SPL if you changed those kinds of
>> settings. The SPL programs these based on the handoff files IIRC.
> 
> I generated the headers using the bsp-editor from Quartus 17 and converted them
> using the qts-filter.sh script in U-Boot. Since then, I did not change any settings.
> 
> sdram.h in board/.../qts and mach-socfpga/
> 
> 	#define CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN	0
> 
> 	#define SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB		10
> 
> wrap_sdram_config.c
> 	.port_cfg =
> 		(CONFIG_HPS_SDR_CTRLCFG_PORTCFG_AUTOPCHEN <<
> 			SDR_CTRLGRP_PORTCFG_AUTOPCHEN_LSB),
> 
> sdram.c
> 	debug("Configuring PORTCFG\n");
> 	writel(cfg->port_cfg, &sdr_ctrl->port_cfg);
> 
> When I add some debug printing around the code shown above, SPL console shows this:
> 
> U-Boot SPL 2018.01-rc1-00129-ga8548b9-dirty (Dec 18 2017 - 14:13:21)
> Content of ffc2507c is 3f
> Wrote 0 to ffc2507c
> Content of ffc2507c is 3f
> drivers/ddr/altera/sequencer.c: Preparing to start memory calibration
> drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
> drivers/ddr/altera/sequencer.c: Calibration complete
> Trying to boot from MMC1
> 
> Maybe the portprotocol part of portcfg is just a status register. But then
> again, why would it be specified as rw?

It should be RW actually.

> Do you have any idea what I might be missing, to get the f2s running without
> programming the FPGA?
CCing Dinh and Chin.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-12-20 16:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 20:44 Socfpga: configure FPGA to SDRAM interface without reprogramming the FPGA Jan Siegmund
2017-12-18 20:44 ` [U-Boot] " Jan Siegmund
2017-12-18 21:05 ` Marek Vasut
2017-12-18 21:05   ` [U-Boot] " Marek Vasut
2017-12-19 23:29   ` Jan Siegmund
2017-12-19 23:29     ` [U-Boot] " Jan Siegmund
2017-12-20  9:35     ` Marek Vasut
2017-12-20  9:35       ` [U-Boot] " Marek Vasut
2017-12-20 11:51       ` Jan Siegmund
2017-12-20 11:51         ` [U-Boot] " Jan Siegmund
2017-12-20 15:06         ` Marek Vasut
2017-12-20 15:06           ` [U-Boot] " Marek Vasut

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.