Hello,
recently I'm trying to add Kconfig support to the M57SLI board from gigabyte, but right now i stumbled into an error where I can't figure out what is wrong.
This problem is not directly related to Kconfig, but it seems that I misunderstand something in the compiler errors, or that I'm not able to fix this one.
The log of make:
hargut@benchvice:~/cb-v2$ make GEN build/build.h CC build/northbridge/amd/amdk8/misc_control.o In file included from src/northbridge/amd/amdk8/amdk8.h:6, from src/northbridge/amd/amdk8/misc_control.c:22: src/northbridge/amd/amdk8/amdk8_f.h:524:21: error: macro "hard_reset" passed 1 arguments, but takes just 0 src/northbridge/amd/amdk8/misc_control.c: In function ‘mcf3_read_resources’: src/northbridge/amd/amdk8/misc_control.c:51: warning: passing argument 2 of ‘get_option’ discards qualifiers from pointer target type src/northbridge/amd/amdk8/misc_control.c: In function ‘misc_control_init’: src/northbridge/amd/amdk8/misc_control.c:113: warning: unused variable ‘f2_dev’ make: *** [/home/hargut/cb-v2/build/northbridge/amd/amdk8/misc_control.o] Error 1 hargut@benchvice:~/cb-v2$ grep hard_reset src/northbridge/amd/amdk8/misc_control.c #include <part/hard_reset.h> hard_reset(); hargut@benchvice:~/cb-v2$ grep hard_reset src/northbridge/amd/amdk8/amdk8_f.h void hard_reset(void); hard_reset(); hargut@benchvice:~/cb-v2$
EOL (End of Log)
The error itself is: src/northbridge/amd/amdk8/amdk8_f.h:524:21: error: macro "hard_reset" passed 1 arguments, but takes just 0
but where gets the hard_reset passed one argument? And or why is hard_reset used as in line 23 of cache_as_ram_auto.c there is the "#define __ROMCC__" which should cause that soft_reset() in amdk8_f.h is used.
"#ifdef __ROMCC__ static void soft_reset(void); #else void hard_reset(void); #endif"
What of that stuff do I misunderstand that I'm not able to fix that compilation error? Or am I unable to see the wood because of so much trees?
Many thanks for any tips on solving that error/understanding problem.
Kind regards, Harald
let's start over. can you tell me what changes you have made to the tree at this time?
ron
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
The tree itself has no changes in source. I just added a few Kconfig and Makefile.inc files.
I think it's not necessary to post the patch right now, the .config should be enough to track that down, or is a full diff against svn needed?
The .config which is generated by Kconfig is attached.
ron
Thanks, regards Harald
On Fri, 2009-08-21 at 13:27 +0200, Harald Gutmann wrote:
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
The tree itself has no changes in source. I just added a few Kconfig and Makefile.inc files.
I think it's not necessary to post the patch right now, the .config should be enough to track that down, or is a full diff against svn needed?
The .config which is generated by Kconfig is attached.
I think the problem is caused by your socket AM2 CPU, which is missing from Kbuild.
The attached patch may help. This is Signed-off by: Cristi Magherusan cristi.magherusan@net.utcluj.ro
On Friday 21 August 2009 14:20:56 Cristi Magherusan wrote:
On Fri, 2009-08-21 at 13:27 +0200, Harald Gutmann wrote:
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
The tree itself has no changes in source. I just added a few Kconfig and Makefile.inc files.
I think it's not necessary to post the patch right now, the .config should be enough to track that down, or is a full diff against svn needed?
The .config which is generated by Kconfig is attached.
I think the problem is caused by your socket AM2 CPU, which is missing from Kbuild.
Thanks for that hint, there have been some errors in that files, but your patch doesn't solve the problem.
The attached patch may help.
Good point, but doesn't solve it.
This is Signed-off by: Cristi Magherusan cristi.magherusan@net.utcluj.ro
Thanks! Regards Harald
On Fri, 2009-08-21 at 14:40 +0200, Harald Gutmann wrote:
On Friday 21 August 2009 14:20:56 Cristi Magherusan wrote:
On Fri, 2009-08-21 at 13:27 +0200, Harald Gutmann wrote:
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
The tree itself has no changes in source. I just added a few Kconfig and Makefile.inc files.
I think it's not necessary to post the patch right now, the .config should be enough to track that down, or is a full diff against svn needed?
The .config which is generated by Kconfig is attached.
I think the problem is caused by your socket AM2 CPU, which is missing from Kbuild.
Thanks for that hint, there have been some errors in that files, but your patch doesn't solve the problem.
The attached patch may help.
Good point, but doesn't solve it.
I've seen you had already implemented what I sent, and my patch was wrong (just copy/pasted from socket F), sorry for this. Your big patch is ok to help us replicate your work, but can't be committed as a whole, which is what we should have as a purpose.
So let's stop reinventing the wheel for each new board, and make smaller patches that add a single piece of functionality which can be commented on, fixed and committed to the tree.
For example the attached patch adds support for AM2 CPUs (I fixed the 0x11 issue).
There's still a debatable issue remaining, which is the inclusion of the src/cpu/amd/model_fxx/Kconfig file.
Is it fine if it's done like in here? Adding it to all the CPU sockets that may need it causes errors due to double inclusions.
Thanks, Cristi
The patch is Signed-off by: Cristi Magherusan cristi.magherusan@net.utcluj.ro
On Fri, Aug 21, 2009 at 9:17 AM, Cristi MagherusanCristi.Magherusan@net.utcluj.ro wrote:
There's still a debatable issue remaining, which is the inclusion of the src/cpu/amd/model_fxx/Kconfig file.
it's ok, Kconfig rules are not makefile rules. Let's just assume we source all subdirectory Kconfigs from a higher level directory.
ron
The patch is Signed-off by: Cristi Magherusan cristi.magherusan@net.utcluj.ro
Acked-by: Myles Watson mylesgw@gmail.com
Rev. 4565.
Thanks, Myles
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
Okay, and here is the full svn diff (hopefully I didn't forget to svn add files) of what I've already done in order to get Kconfig working on that mainboard.
ron
Regards, Harald
On Friday 21 August 2009 14:09:35 Harald Gutmann wrote:
On Friday 21 August 2009 00:06:44 ron minnich wrote:
let's start over. can you tell me what changes you have made to the tree at this time?
Okay, and here is the full svn diff (hopefully I didn't forget to svn add files) of what I've already done in order to get Kconfig working on that mainboard.
New version with some corrected errors. Thanks Christi for the hint!
ron
Regards, Harald
This is *almost* perfect. Questions and changes.
Index: src/cpu/amd/socket_AM2/Kconfig =================================================================== --- src/cpu/amd/socket_AM2/Kconfig (revision 0) +++ src/cpu/amd/socket_AM2/Kconfig (revision 0) @@ -0,0 +1,30 @@ +config CPU_AMD_SOCKET_AM2 + bool + default false + +config CPU_SOCKET_TYPE + hex + default 0x10 + depends on CPU_AMD_SOCKET_AM2
It's a type 0x10?
+ +config K8_REV_F_SUPPORT + int + default 1 + depends on CPU_AMD_SOCKET_AM2
Socket AM2 supports REV F? I don't know, just asking.
+config CPU_SOCKET_TYPE + hex + default 0x11 + depends on CPU_AMD_SOCKET_AM2
it's in here twice.
Index: src/cpu/amd/socket_AM2/Makefile.inc =================================================================== --- src/cpu/amd/socket_AM2/Makefile.inc (revision 0) +++ src/cpu/amd/socket_AM2/Makefile.inc (revision 0) @@ -0,0 +1,14 @@ +obj-$(CONFIG_CPU_AMD_SOCKET_AM2) += socket_AM.o +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../model_fxx +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../dualcore +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/tsc +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/fpu +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mmx +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/sse +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/lapic +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/cache +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/pae +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/smm
Just make these -y. This Makefile.inc is *conditionally* included from the src/cpu/amd/Makefile.inc. There's no reason to make them conditional in turn.
Let's go around one more time taking into account my comments. We are almost there.
ron
New patch version attached, but the compile error stays at the same state than before.
On Friday 21 August 2009 17:31:17 ron minnich wrote:
This is *almost* perfect. Questions and changes.
I think it would be possible to sparse some values in the mainboard directory out, but that's a todo after fixing compilation.
Index: src/cpu/amd/socket_AM2/Kconfig
--- src/cpu/amd/socket_AM2/Kconfig (revision 0) +++ src/cpu/amd/socket_AM2/Kconfig (revision 0) @@ -0,0 +1,30 @@ +config CPU_AMD_SOCKET_AM2
- bool
- default false
+config CPU_SOCKET_TYPE
- hex
- default 0x10
- depends on CPU_AMD_SOCKET_AM2
It's a type 0x10?
+config K8_REV_F_SUPPORT
- int
- default 1
- depends on CPU_AMD_SOCKET_AM2
Socket AM2 supports REV F? I don't know, just asking.
+config CPU_SOCKET_TYPE
- hex
- default 0x11
- depends on CPU_AMD_SOCKET_AM2
it's in here twice.
Index: src/cpu/amd/socket_AM2/Makefile.inc
--- src/cpu/amd/socket_AM2/Makefile.inc (revision 0) +++ src/cpu/amd/socket_AM2/Makefile.inc (revision 0) @@ -0,0 +1,14 @@ +obj-$(CONFIG_CPU_AMD_SOCKET_AM2) += socket_AM.o +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../model_fxx +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../dualcore +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/tsc +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/fpu +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mmx +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/sse +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/lapic +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/cache +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/mtrr +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/pae +subdirs-$(CONFIG_CPU_AMD_SOCKET_AM2) += ../../x86/smm
Just make these -y. This Makefile.inc is *conditionally* included from the src/cpu/amd/Makefile.inc. There's no reason to make them conditional in turn.
Let's go around one more time taking into account my comments. We are almost there.
ron
I'm missing src/southbridge/nvidia/ck804/Kconfig ron
On Friday 21 August 2009 18:10:37 ron minnich wrote:
I'm missing src/southbridge/nvidia/ck804/Kconfig
Yes, because that's not needed. The m57sli board has a mcp55 southbridge and therefore ck804 is not needed. I removed this because I wanted to clean out and sort up the patch as far as possible.
Index: src/southbridge/nvidia/Kconfig =================================================================== --- src/southbridge/nvidia/Kconfig (revision 4560) +++ src/southbridge/nvidia/Kconfig (working copy) @@ -1,2 +1 @@ -source src/southbridge/nvidia/ck804/Kconfig source src/southbridge/nvidia/mcp55/Kconfig
This sould fix also that little line, but I don't think that this affects my problem, as Kconfig would complain if it needs that file.
ron
Regards, Harald
This problem is not directly related to Kconfig, but it seems that I misunderstand something in the compiler errors, or that I'm not able to fix this one.
The log of make:
hargut@benchvice:~/cb-v2$ make GEN build/build.h CC build/northbridge/amd/amdk8/misc_control.o In file included from src/northbridge/amd/amdk8/amdk8.h:6, from src/northbridge/amd/amdk8/misc_control.c:22: src/northbridge/amd/amdk8/amdk8_f.h:524:21: error: macro "hard_reset" passed 1 arguments, but takes just 0
I'm having similar problems (at least it looks similar to me). My ck804_reset.c file never gets compiled.
Here is my src/southbridge/nvidia/ck804/Makefile.inc:
driver-y += ck804.o driver-y += ck804_usb.o driver-y += ck804_lpc.o driver-y += ck804_smbus.o driver-y += ck804_ide.o driver-y += ck804_sata.o driver-y += ck804_usb2.o driver-y += ck804_ac97.o driver-y += ck804_nic.o driver-y += ck804_pci.o driver-y += ck804_pcie.o driver-y += ck804_ht.o object-y += ck804_reset.o
object-$(CONFIG_HAVE_ACPI_TABLES) +=ck804_fadt.o
All of the drivers get compiled, but the two objects are never compiled.
Any suggestions?
Thanks, Myles
On Fri, Aug 21, 2009 at 9:44 AM, Myles Watsonmylesgw@gmail.com wrote:
ck804_reset.c file never gets compiled.
object-y += ck804_reset.o
object-$(CONFIG_HAVE_ACPI_TABLES) +=ck804_fadt.o
obj-y is the correct syntax. Sorry for the noise.
one last correction: obj-$(CONFIG_HAVE_ACPI_TABLES) +=ck804_fadt.o
since it is conditional on that variable.
ron
hargut@benchvice:~/cb-v2$ make GEN build/build.h CC build/northbridge/amd/amdk8/misc_control.o In file included from src/northbridge/amd/amdk8/amdk8.h:6, from src/northbridge/amd/amdk8/misc_control.c:22: src/northbridge/amd/amdk8/amdk8_f.h:524:21: error: macro "hard_reset" passed 1 arguments, but takes just 0
I'm having similar problems (at least it looks similar to me). My ck804_reset.c file never gets compiled.
I applied your patch, and it doesn't look like you uncomment the line in src/southbridge/nvidia/Makefile.inc so that mcp55 gets built.
Myles
let's slow down on these patches.
We're moving way too fast and it's getting confusing, and errors and mistakes are creeping in. Cristi is right.
Let's first do AM2. Then nvidia south. And so on.
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
ron
Let's first do AM2. Then nvidia south. And so on.
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south. From Cristi's patch:
--- /dev/null +++ b/src/cpu/amd/microcode/Makefile.inc @@ -0,0 +1 @@ +obj-y += microcode.o
Let's not create a whole file for one obj. Can we just put that in socket_AM2/Makefile.inc like the intel sockets do?
obj-y += ../microcode/microcode.o
Thanks, Myles
On Fri, Aug 21, 2009 at 11:09 AM, Myles Watsonmylesgw@gmail.com wrote:
Let's first do AM2. Then nvidia south. And so on.
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
From Cristi's patch: --- /dev/null +++ b/src/cpu/amd/microcode/Makefile.inc @@ -0,0 +1 @@ +obj-y += microcode.o
Let's not create a whole file for one obj. Can we just put that in socket_AM2/Makefile.inc like the intel sockets do?
obj-y += ../microcode/microcode.o
The reason to create a whole file for one object is that, over time, kif we get more than one object, nobody has to change their makefiles -- we add to microcode/Makefile.inc.
I think the subdir usage and extra Makefile.inc are fine, if we're going to have the directory.
At same time, I'm not overly concerned either way. I have to go out rest of the day, the AM2 patch is almost there, Myles, can you and Cristi wrap it up?
ron
Let's not create a whole file for one obj. Can we just put that in socket_AM2/Makefile.inc like the intel sockets do?
obj-y += ../microcode/microcode.o
The reason to create a whole file for one object is that, over time, kif we get more than one object, nobody has to change their makefiles -- we add to microcode/Makefile.inc.
I think the subdir usage and extra Makefile.inc are fine, if we're going to have the directory.
OK.
At same time, I'm not overly concerned either way. I have to go out rest of the day, the AM2 patch is almost there, Myles, can you and Cristi wrap it up?
I've made so many Kconfig mistakes I'm not sure I'm the right person to Ack & commit. But I don't have any objections to the patch.
Myles
On Friday 21 August 2009 20:00:23 ron minnich wrote:
let's slow down on these patches.
We're moving way too fast and it's getting confusing, and errors and mistakes are creeping in. Cristi is right.
Let's first do AM2. Then nvidia south. And so on.
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
Okay, sounds good.
I've reviewed the mcp55 Kconfig once more and attached it. It seems for me that it is fine, and should work normally.
This patch is: Signed-off-by: Harald Gutmann harald.gutmann@gmx.net
ron
Harald
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
Okay, sounds good.
Lets not create a new CONFIG variable SOUTHBRIDGE_NVIDIA_MCP55. I think that whole file can go. And the files that source it. Index: nvidia/mcp55/Kconfig Index: nvidia/Kconfig
I'd rather you didn't remove the ck804 references, since my patch will have to put them back.
+driver-$(CONFIG_HAVE_ACPI_TABLES) += mcp55_fadt.o I think you mean obj here.
Thanks, Myles
On Friday 21 August 2009 20:21:27 Myles Watson wrote:
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
Okay, sounds good.
Lets not create a new CONFIG variable SOUTHBRIDGE_NVIDIA_MCP55. I think that whole file can go. And the files that source it. Index: nvidia/mcp55/Kconfig Index: nvidia/Kconfig
Are you sure that this will work as in the mainboard/{vendor}/{model}/Kconfig it is used to select which sb is used. (Maybe I'm wrong with this, but I used the amd_serengeti target as starting point, and there it's done the same way.)
For example here on my board it looks like: config BOARD_GIGABYTE_M57SLI bool "M57SLI" select ARCH_X86 select CPU_AMD_K8 select CPU_AMD_SOCKET_AM2 select NORTHBRIDGE_AMD_AMDK8 select NORTHBRIDGE_AMD_AMDK8_ROOT_COMPLEX select SOUTHBRIDGE_NVIDIA_MCP55 select SUPERIO_WINBOND_IT8716F select PIRQ_TABLE select USE_PRINTK_IN_CAR help Gigabyte M57SLI mainboard endchoice
I'd rather you didn't remove the ck804 references, since my patch will have to put them back.
Done.
+driver-$(CONFIG_HAVE_ACPI_TABLES) += mcp55_fadt.o I think you mean obj here.
Yes.
v2 of the patch attached, with some more (little) modifications.
Thanks, Myles
Thanks, Harald
On Fri, Aug 21, 2009 at 12:33 PM, Harald Gutmannharald.gutmann@gmx.net wrote:
On Friday 21 August 2009 20:21:27 Myles Watson wrote:
OK, I am going to apply Cristi's patch, and, if it looks good, commit. Then we can do nvidia south.
Okay, sounds good.
Lets not create a new CONFIG variable SOUTHBRIDGE_NVIDIA_MCP55. I think that whole file can go. And the files that source it. Index: nvidia/mcp55/Kconfig Index: nvidia/Kconfig
Are you sure that this will work as in the mainboard/{vendor}/{model}/Kconfig it is used to select which sb is used. (Maybe I'm wrong with this, but I used the amd_serengeti target as starting point, and there it's done the same way.)
You're right. The reason I was questioning it was that I grepped the tree and didn't find any CONFIG_SOUTHBRIDGE_NVIDIA*
I think the correct fix for that problem is to change src/southbridge/nvidia/Makefile.inc subdirs-y should be subdirs-$(CONFIG_SOUTHBRIDGE_NVIDIA_MCP55).
Does that sound better?
I'd rather you didn't remove the ck804 references, since my patch will have to put them back.
Done.
+driver-$(CONFIG_HAVE_ACPI_TABLES) += mcp55_fadt.o I think you mean obj here.
Yes.
v2 of the patch attached, with some more (little) modifications.
Thanks, Myles
On Fri, Aug 21, 2009 at 12:14 PM, Myles Watsonmylesgw@gmail.com wrote:
I think the correct fix for that problem is to change src/southbridge/nvidia/Makefile.inc subdirs-y should be subdirs-$(CONFIG_SOUTHBRIDGE_NVIDIA_MCP55).
yes!
This is the general rule. It's even in my small Kconfig.tex doco :-)
ron
On Fri, Aug 21, 2009 at 2:41 PM, ron minnichrminnich@gmail.com wrote:
On Fri, Aug 21, 2009 at 12:14 PM, Myles Watsonmylesgw@gmail.com wrote:
I think the correct fix for that problem is to change src/southbridge/nvidia/Makefile.inc subdirs-y should be subdirs-$(CONFIG_SOUTHBRIDGE_NVIDIA_MCP55).
yes!
This is the general rule. It's even in my small Kconfig.tex doco :-)
Unfortunately it fits into the category of "the tree speaks louder than the docs." We shouldn't have missed it, but we did.
Myles