* [U-Boot] BIOS EMULATOR driver @ 2012-03-25 17:23 Viktor Křivák 2012-03-25 18:30 ` Wolfgang Denk 0 siblings, 1 reply; 27+ messages in thread From: Viktor Křivák @ 2012-03-25 17:23 UTC (permalink / raw) To: u-boot Hello, I'm working on one project about bios emulator and I notice that this driver is linked for boards P1022DS and sequoia too, but they don't really use any methods of it. It's safe to remove this support from configs files? Whole this driver is seems to be imported from somewhere and lots of its code is unused Actually only one method is used. It's safe to clean this too? Thanks for answer Viktor Krivak ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-25 17:23 [U-Boot] BIOS EMULATOR driver Viktor Křivák @ 2012-03-25 18:30 ` Wolfgang Denk 2012-03-25 23:09 ` Viktor Křivák 0 siblings, 1 reply; 27+ messages in thread From: Wolfgang Denk @ 2012-03-25 18:30 UTC (permalink / raw) To: u-boot Dear Viktor, In message <CAJxx_ay7FAz-SJ0k2cBqWd1meVhDqm6vtESy=T6f9rs=KatBhQ@mail.gmail.com> you wrote: > > I'm working on one project about bios emulator and I notice that this > driver is linked for boards P1022DS and sequoia too, but they don't really > use any methods of it. It's safe to remove this support from configs files? Are you sure that the code is not used? sequoia: #define CONFIG_BIOSEMU /* x86 bios emulator for vga bios */ #define CONFIG_ATI_RADEON_FB /* use radeon framebuffer driver */ ... P1022DS: #define CONFIG_BIOSEMU ... #define CONFIG_ATI_RADEON_FB These boards enable the BIOS emulator to initialize the BIOS on ATI Radeon graphics cards; CONFIG_ATI_RADEON_FB causes that ati_radeon_fb ("drivers/video/ati_radeon_fb.c") gets included; this code calls (among other things) BootVideoCardBIOS() ... > Whole this driver is seems to be imported from somewhere and lots of its > code is unused Actually only one method is used. It's safe to clean this > too? If you disable all the graphics code, yes. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." - George Bernard Shaw ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-25 18:30 ` Wolfgang Denk @ 2012-03-25 23:09 ` Viktor Křivák 2012-03-26 5:51 ` Wolfgang Denk 0 siblings, 1 reply; 27+ messages in thread From: Viktor Křivák @ 2012-03-25 23:09 UTC (permalink / raw) To: u-boot Dear Wolfgang, > > I'm working on one project about bios emulator and I notice that this > > driver is linked for boards P1022DS and sequoia too, but they don't > > really > > use any methods of it. It's safe to remove this support from configs > > files? > > Are you sure that the code is not used? I pretty sure because I try compile it without this driver and everything seems to be ok. > > Best regards, > > Wolfgang Denk > Best regards Viktor Krivak ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-25 23:09 ` Viktor Křivák @ 2012-03-26 5:51 ` Wolfgang Denk 2012-03-26 10:43 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Wolfgang Denk @ 2012-03-26 5:51 UTC (permalink / raw) To: u-boot Dear Viktor, In message <CAJxx_awWp1wSLhu0e0Dzk+ZhAYFjY+98AACo9f_6KxswZkktrA@mail.gmail.com> you wrote: > > > > I'm working on one project about bios emulator and I notice that this > > > driver is linked for boards P1022DS and sequoia too, but they don't > > > really > > > use any methods of it. It's safe to remove this support from configs > > > files? > > > > Are you sure that the code is not used? > > I pretty sure because I try compile it without this driver and > everything seems to be ok. In the given configurations, the BIOS code only gets built when you the ATI Radeon support is enabled, in which case it is needed. If you don't enable either, then it's fine as well - but then the BIOS code does not get built anyway. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Minds are like parachutes - they only function when open. ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 5:51 ` Wolfgang Denk @ 2012-03-26 10:43 ` Marek Vasut 2012-03-26 13:08 ` Wolfgang Denk 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-26 10:43 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Viktor, > > In message <CAJxx_awWp1wSLhu0e0Dzk+ZhAYFjY+98AACo9f_6KxswZkktrA@mail.gmail.com> you wrote: > > > > I'm working on one project about bios emulator and I notice that this > > > > driver is linked for boards P1022DS and sequoia too, but they don't > > > > really > > > > use any methods of it. It's safe to remove this support from configs > > > > files? > > > > > > Are you sure that the code is not used? > > > > I pretty sure because I try compile it without this driver and > > everything seems to be ok. > > In the given configurations, the BIOS code only gets built when you > the ATI Radeon support is enabled, in which case it is needed. > > If you don't enable either, then it's fine as well - but then the BIOS > code does not get built anyway. But we probably want this driver to work, so ... > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 10:43 ` Marek Vasut @ 2012-03-26 13:08 ` Wolfgang Denk 2012-03-26 13:31 ` Marek Vasut 2012-03-26 13:47 ` Viktor Křivák 0 siblings, 2 replies; 27+ messages in thread From: Wolfgang Denk @ 2012-03-26 13:08 UTC (permalink / raw) To: u-boot Dear Marek Vasut, In message <201203261243.19732.marex@denx.de> you wrote: > > > > I pretty sure because I try compile it without this driver and > > > everything seems to be ok. > > > > In the given configurations, the BIOS code only gets built when you > > the ATI Radeon support is enabled, in which case it is needed. > > > > If you don't enable either, then it's fine as well - but then the BIOS > > code does not get built anyway. > > But we probably want this driver to work, so ... I'm not sure what your comment means. If you want to use this driver, then enable it in the configuration; this will mean the BIOS emulator also gets built and linked, and it will be needed to initialize the card's BIOS. Everything is fine. No problems anywhere. What exactly was your concern? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Certainly there are things in life that money can't buy, but it's very funny - Did you ever try buying them without money? - Ogden Nash ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 13:08 ` Wolfgang Denk @ 2012-03-26 13:31 ` Marek Vasut 2012-03-26 20:14 ` Wolfgang Denk 2012-03-26 13:47 ` Viktor Křivák 1 sibling, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-26 13:31 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Marek Vasut, > > In message <201203261243.19732.marex@denx.de> you wrote: > > > > I pretty sure because I try compile it without this driver and > > > > everything seems to be ok. > > > > > > In the given configurations, the BIOS code only gets built when you > > > the ATI Radeon support is enabled, in which case it is needed. > > > > > > If you don't enable either, then it's fine as well - but then the BIOS > > > code does not get built anyway. > > > > But we probably want this driver to work, so ... > > I'm not sure what your comment means. > > If you want to use this driver, then enable it in the configuration; > this will mean the BIOS emulator also gets built and linked, and it > will be needed to initialize the card's BIOS. > > Everything is fine. No problems anywhere. Right. My concern was about: "I pretty sure because I try compile it without this driver and everything seems to be ok." So that means the board work without this bios emulator driver if the radeon driver is disabled? But we want to use the radeon driver, so we need the bios emulator stuff. I think the discussion quite drifted away from the original question, which was if the dead code in bios emulator stuff can be simply removed? ... and if it really is dead code. > > > What exactly was your concern? > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 13:31 ` Marek Vasut @ 2012-03-26 20:14 ` Wolfgang Denk 2012-03-26 23:06 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Wolfgang Denk @ 2012-03-26 20:14 UTC (permalink / raw) To: u-boot Dear Marek Vasut, In message <201203261531.18334.marex@denx.de> you wrote: > > So that means the board work without this bios emulator driver if the radeon > driver is disabled? But we want to use the radeon driver, so we need the bios > emulator stuff. Right. If you don't need feature X and do not configure it, then you don't need the driver that implements feature X, and building without this driver works. If you need feature X, then you must include it, and it is usually no dead code then. And even if it was, the combination of -ffunction-sections / -fdata-sections with --gc-sections should prevent any damages. > I think the discussion quite drifted away from the original question, which was > if the dead code in bios emulator stuff can be simply removed? ... and if it > really is dead code. If you need the BIOS emulator to initialize the BIOS of a graphics card it it probably not exactly "dead code". Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Every time history repeats itself the price goes up. ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 20:14 ` Wolfgang Denk @ 2012-03-26 23:06 ` Marek Vasut 2012-03-27 5:18 ` Viktor Křivák 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-26 23:06 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Marek Vasut, > > In message <201203261531.18334.marex@denx.de> you wrote: > > So that means the board work without this bios emulator driver if the > > radeon driver is disabled? But we want to use the radeon driver, so we > > need the bios emulator stuff. > > Right. If you don't need feature X and do not configure it, then you > don't need the driver that implements feature X, and building without > this driver works. If you need feature X, then you must include it, > and it is usually no dead code then. > > And even if it was, the combination of -ffunction-sections / > -fdata-sections with --gc-sections should prevent any damages. Well, certainly ... but from what Viktor told me, there are slabs of dead code in this stuff. > > > I think the discussion quite drifted away from the original question, > > which was if the dead code in bios emulator stuff can be simply removed? > > ... and if it really is dead code. > > If you need the BIOS emulator to initialize the BIOS of a graphics > card it it probably not exactly "dead code". Certainly, though I'm not confident if all of the bios emulator stuff is used. > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 23:06 ` Marek Vasut @ 2012-03-27 5:18 ` Viktor Křivák 2012-03-27 17:28 ` Wolfgang Denk 0 siblings, 1 reply; 27+ messages in thread From: Viktor Křivák @ 2012-03-27 5:18 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk and Marek Vasut, 2012/3/27 Marek Vasut <marek.vasut@gmail.com>: > Dear Wolfgang Denk, > >> Dear Marek Vasut, >> >> In message <201203261531.18334.marex@denx.de> you wrote: >> > So that means the board work without this bios emulator driver if the >> > radeon driver is disabled? But we want to use the radeon driver, so we >> > need the bios emulator stuff. >> >> Right. ?If you don't need feature X and do not configure it, then you >> don't need the driver that implements feature X, and building without >> this driver works. ?If you need feature X, then you must include it, >> and it is usually no dead code then. >> >> And even if it was, the combination of -ffunction-sections / >> -fdata-sections with --gc-sections should prevent any damages. > > Well, certainly ... but from what Viktor told me, there are slabs of dead code > in this stuff. >> >> > I think the discussion quite drifted away from the original question, >> > which was if the dead code in bios emulator stuff can be simply removed? >> > ... and if it really is dead code. >> >> If you need the BIOS emulator to initialize the BIOS of a graphics >> card it it probably not exactly "dead code". > > Certainly, though I'm not confident if all of the bios emulator stuff is used. Yes that's the main problem. Lots of code i unused. Basically everything except BootVideoCardBIOS, that is use in ATI video driver. I've got two solution of this problem. First, mark all unused code by some macro and compile it only conditionally or remove it. But I not sure if someone use this death code for debug purposes. >> >> Best regards, >> >> Wolfgang Denk > > Best regards, > Marek Vasut Best regards, Viktor Krivak ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 5:18 ` Viktor Křivák @ 2012-03-27 17:28 ` Wolfgang Denk 2012-03-27 17:48 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Wolfgang Denk @ 2012-03-27 17:28 UTC (permalink / raw) To: u-boot Dear =?ISO-8859-2?Q?Viktor_K=F8iv=E1k?=, In message <CAJxx_aysp3cO1CasSNgycqE_yDNiBcMRwJ7P6GGR6T-d9QbB-A@mail.gmail.com> you wrote: > > >> And even if it was, the combination of -ffunction-sections / > >> -fdata-sections with --gc-sections should prevent any damages. ... > Yes that's the main problem. Lots of code i unused. Basically > everything except BootVideoCardBIOS, that is use in ATI video driver. > I've got two solution of this problem. First, mark all unused code by > some macro and compile it only conditionally or remove it. But I not > sure if someone use this death code for debug purposes. Did you check if you really find any such code in your linked image? As I already explained, normally -ffunction-sections / -fdata-sections with --gc-sections should make sure any unused functions get dropped automatically. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I don't mind criticism. You know me. I've never been one to take offence at criticism. No one could say I'm the sort to take offence at criticism -- Not twice, anyway. Not without blowing bubbles. - Terry Pratchett, _Witches Abroad_ ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 17:28 ` Wolfgang Denk @ 2012-03-27 17:48 ` Marek Vasut 2012-03-27 17:51 ` Timur Tabi 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-27 17:48 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear =?ISO-8859-2?Q?Viktor_K=F8iv=E1k?=, > > In message <CAJxx_aysp3cO1CasSNgycqE_yDNiBcMRwJ7P6GGR6T-d9QbB- A@mail.gmail.com> you wrote: > > >> And even if it was, the combination of -ffunction-sections / > > >> -fdata-sections with --gc-sections should prevent any damages. > > ... > > > Yes that's the main problem. Lots of code i unused. Basically > > everything except BootVideoCardBIOS, that is use in ATI video driver. > > I've got two solution of this problem. First, mark all unused code by > > some macro and compile it only conditionally or remove it. But I not > > sure if someone use this death code for debug purposes. > > Did you check if you really find any such code in your linked image? > As I already explained, normally -ffunction-sections / -fdata-sections > with --gc-sections should make sure any unused functions get dropped > automatically. Sure, but I see no point in keeping such dead code in U-Boot code base. Aka. why keep functions in U-Boot that are never used? > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 17:48 ` Marek Vasut @ 2012-03-27 17:51 ` Timur Tabi 2012-03-27 17:58 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Timur Tabi @ 2012-03-27 17:51 UTC (permalink / raw) To: u-boot Marek Vasut wrote: > Sure, but I see no point in keeping such dead code in U-Boot code base. Aka. why > keep functions in U-Boot that are never used? I think what Wolfgang is trying to say is that no one has proven that there actually IS any unused code. The ATI driver needs the BIOS emulator, so you need to enable support for the ATI driver to see what is and is not actually used. Just because it's not enabled currently in any board, that doesn't mean that the code is useless. -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 17:51 ` Timur Tabi @ 2012-03-27 17:58 ` Marek Vasut 2012-03-27 17:59 ` Timur Tabi 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-27 17:58 UTC (permalink / raw) To: u-boot Dear Timur Tabi, > Marek Vasut wrote: > > Sure, but I see no point in keeping such dead code in U-Boot code base. > > Aka. why keep functions in U-Boot that are never used? > > I think what Wolfgang is trying to say is that no one has proven that > there actually IS any unused code. The ATI driver needs the BIOS > emulator, so you need to enable support for the ATI driver to see what is > and is not actually used. Just because it's not enabled currently in any > board, that doesn't mean that the code is useless. Agreed, but I expected there was some dead code and that was the point I was trying to express ;-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 17:58 ` Marek Vasut @ 2012-03-27 17:59 ` Timur Tabi 2012-03-27 20:11 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Timur Tabi @ 2012-03-27 17:59 UTC (permalink / raw) To: u-boot Marek Vasut wrote: > Agreed, but I expected there was some dead code and that was the point I was > trying to express ;-) Well, until you do a thorough analysis, you really have no idea if there is any dead code at all. -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 17:59 ` Timur Tabi @ 2012-03-27 20:11 ` Marek Vasut 2012-03-27 22:46 ` Viktor Křivák 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-27 20:11 UTC (permalink / raw) To: u-boot Dear Timur Tabi, > Marek Vasut wrote: > > Agreed, but I expected there was some dead code and that was the point I > > was trying to express ;-) > > Well, until you do a thorough analysis, you really have no idea if there > is any dead code at all. I don't ... but Viktor probably does and I believe that's what he wants to ask about. Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 20:11 ` Marek Vasut @ 2012-03-27 22:46 ` Viktor Křivák 2012-03-27 22:56 ` Graeme Russ 0 siblings, 1 reply; 27+ messages in thread From: Viktor Křivák @ 2012-03-27 22:46 UTC (permalink / raw) To: u-boot Dear Timur Tabi, 2012/3/27 Marek Vasut <marex@denx.de>: > Dear Timur Tabi, > >> Marek Vasut wrote: >> > Agreed, but I expected there was some dead code and that was the point I >> > was trying to express ;-) >> >> Well, until you do a thorough analysis, you really have no idea if there >> is any dead code at all. > > I don't ... but Viktor probably does and I believe that's what he wants to ask > about. Yes I do the analysis, actually only one method is used (PCI_mapBIOSImage), but there are two other methods related to video card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, PCI_unmapBIOSImage). Nothing calls they but I think they can be preserved too. But there are a lots of other code which can be removed. For example BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or BE_getVESABuf() from same file. So my question is: It is safe remove dead code or somebody can use it for debugging purposes ? I've got same problem with another driver so this is general question. Best regards, Viktor Krivak ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 22:46 ` Viktor Křivák @ 2012-03-27 22:56 ` Graeme Russ 2012-03-27 23:46 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Graeme Russ @ 2012-03-27 22:56 UTC (permalink / raw) To: u-boot Hi Viktor, On Wed, Mar 28, 2012 at 9:46 AM, Viktor K?iv?k <viktor.krivak@gmail.com> wrote: > Dear Timur Tabi, > > 2012/3/27 Marek Vasut <marex@denx.de>: >> Dear Timur Tabi, >> >>> Marek Vasut wrote: >>> > Agreed, but I expected there was some dead code and that was the point I >>> > was trying to express ;-) >>> >>> Well, until you do a thorough analysis, you really have no idea if there >>> is any dead code at all. >> >> I don't ... but Viktor probably does and I believe that's what he wants to ask >> about. > > Yes I do the analysis, actually only one method is used > (PCI_mapBIOSImage), but there are two other methods related to video > card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, > PCI_unmapBIOSImage). Nothing calls they but I think they can be > preserved too. > > But there are a lots of other code which can be removed. For example > BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or > BE_getVESABuf() from same file. So my question is: It is safe remove > dead code or somebody can use it for debugging purposes ? I've got > same problem with another driver so this is general question. What exactly is the problem? Wolfgang previously pointed out: "Did you check if you really find any such code in your linked image? As I already explained, normally -ffunction-sections / -fdata-sections with --gc-sections should make sure any unused functions get dropped automatically." If these linker options successfully remove all of the dead code, then there should be no urgency in removing it. However, if you are experiencing compile errors due to unused functions, then yes, removing the dead code should be investigated. But if you plan to remove any code, make sure that there are no other boards which may potentially use the code you plan to remove Regards, Graeme ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 22:56 ` Graeme Russ @ 2012-03-27 23:46 ` Marek Vasut 2012-03-27 23:51 ` Graeme Russ 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-27 23:46 UTC (permalink / raw) To: u-boot Dear Graeme Russ, > Hi Viktor, > > On Wed, Mar 28, 2012 at 9:46 AM, Viktor K?iv?k <viktor.krivak@gmail.com> wrote: > > Dear Timur Tabi, > > > > 2012/3/27 Marek Vasut <marex@denx.de>: > >> Dear Timur Tabi, > >> > >>> Marek Vasut wrote: > >>> > Agreed, but I expected there was some dead code and that was the > >>> > point I was trying to express ;-) > >>> > >>> Well, until you do a thorough analysis, you really have no idea if > >>> there is any dead code at all. > >> > >> I don't ... but Viktor probably does and I believe that's what he wants > >> to ask about. > > > > Yes I do the analysis, actually only one method is used > > (PCI_mapBIOSImage), but there are two other methods related to video > > card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, > > PCI_unmapBIOSImage). Nothing calls they but I think they can be > > preserved too. > > > > But there are a lots of other code which can be removed. For example > > BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or > > BE_getVESABuf() from same file. So my question is: It is safe remove > > dead code or somebody can use it for debugging purposes ? I've got > > same problem with another driver so this is general question. > > What exactly is the problem? > > Wolfgang previously pointed out: > > "Did you check if you really find any such code in your linked image? > As I already explained, normally -ffunction-sections / -fdata-sections > with --gc-sections should make sure any unused functions get dropped > automatically." > > If these linker options successfully remove all of the dead code, then > there should be no urgency in removing it. However, if you are > experiencing compile errors due to unused functions, then yes, removing > the dead code should be investigated. But if you plan to remove any > code, make sure that there are no other boards which may potentially use > the code you plan to remove Greame, it's the UDM plight ... killing all dead code really helps streamlining the API. > > Regards, > > Graeme Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 23:46 ` Marek Vasut @ 2012-03-27 23:51 ` Graeme Russ 2012-03-27 23:56 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Graeme Russ @ 2012-03-27 23:51 UTC (permalink / raw) To: u-boot Hi Marek, On Wed, Mar 28, 2012 at 10:46 AM, Marek Vasut <marex@denx.de> wrote: > Dear Graeme Russ, > >> Hi Viktor, >> >> On Wed, Mar 28, 2012 at 9:46 AM, Viktor K?iv?k <viktor.krivak@gmail.com> > wrote: >> > Dear Timur Tabi, >> > >> > 2012/3/27 Marek Vasut <marex@denx.de>: >> >> Dear Timur Tabi, >> >> >> >>> Marek Vasut wrote: >> >>> > Agreed, but I expected there was some dead code and that was the >> >>> > point I was trying to express ;-) >> >>> >> >>> Well, until you do a thorough analysis, you really have no idea if >> >>> there is any dead code at all. >> >> >> >> I don't ... but Viktor probably does and I believe that's what he wants >> >> to ask about. >> > >> > Yes I do the analysis, actually only one method is used >> > (PCI_mapBIOSImage), but there are two other methods related to video >> > card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, >> > PCI_unmapBIOSImage). Nothing calls they but I think they can be >> > preserved too. >> > >> > But there are a lots of other code which can be removed. For example >> > BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or >> > BE_getVESABuf() from same file. So my question is: It is safe remove >> > dead code or somebody can use it for debugging purposes ? I've got >> > same problem with another driver so this is general question. >> >> What exactly is the problem? >> >> Wolfgang previously pointed out: >> >> "Did you check if you really find any such code in your linked image? >> As I already explained, normally -ffunction-sections / -fdata-sections >> with --gc-sections should make sure any unused functions get dropped >> automatically." >> >> If these linker options successfully remove all of the dead code, then >> there should be no urgency in removing it. However, if you are >> experiencing compile errors due to unused functions, then yes, removing >> the dead code should be investigated. But if you plan to remove any >> code, make sure that there are no other boards which may potentially use >> the code you plan to remove > > Greame, it's the UDM plight ... killing all dead code really helps streamlining > the API. Ah, I see - Well, I won't stand in the way of progress ;) Regards, Graeme ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 23:51 ` Graeme Russ @ 2012-03-27 23:56 ` Marek Vasut 2012-03-28 0:00 ` Graeme Russ 0 siblings, 1 reply; 27+ messages in thread From: Marek Vasut @ 2012-03-27 23:56 UTC (permalink / raw) To: u-boot Dear Graeme Russ, > Hi Marek, > > On Wed, Mar 28, 2012 at 10:46 AM, Marek Vasut <marex@denx.de> wrote: > > Dear Graeme Russ, > > > >> Hi Viktor, > >> > >> On Wed, Mar 28, 2012 at 9:46 AM, Viktor K?iv?k <viktor.krivak@gmail.com> > > > > wrote: > >> > Dear Timur Tabi, > >> > > >> > 2012/3/27 Marek Vasut <marex@denx.de>: > >> >> Dear Timur Tabi, > >> >> > >> >>> Marek Vasut wrote: > >> >>> > Agreed, but I expected there was some dead code and that was the > >> >>> > point I was trying to express ;-) > >> >>> > >> >>> Well, until you do a thorough analysis, you really have no idea if > >> >>> there is any dead code at all. > >> >> > >> >> I don't ... but Viktor probably does and I believe that's what he > >> >> wants to ask about. > >> > > >> > Yes I do the analysis, actually only one method is used > >> > (PCI_mapBIOSImage), but there are two other methods related to video > >> > card. Booth in file drivers/bios_emulator/atibios.c (PCI_mapBIOSImage, > >> > PCI_unmapBIOSImage). Nothing calls they but I think they can be > >> > preserved too. > >> > > >> > But there are a lots of other code which can be removed. For example > >> > BE_mapRealPointer() from drivers/bios_emulator/biosemu.c or > >> > BE_getVESABuf() from same file. So my question is: It is safe remove > >> > dead code or somebody can use it for debugging purposes ? I've got > >> > same problem with another driver so this is general question. > >> > >> What exactly is the problem? > >> > >> Wolfgang previously pointed out: > >> > >> "Did you check if you really find any such code in your linked image? > >> As I already explained, normally -ffunction-sections / -fdata-sections > >> with --gc-sections should make sure any unused functions get dropped > >> automatically." > >> > >> If these linker options successfully remove all of the dead code, then > >> there should be no urgency in removing it. However, if you are > >> experiencing compile errors due to unused functions, then yes, removing > >> the dead code should be investigated. But if you plan to remove any > >> code, make sure that there are no other boards which may potentially use > >> the code you plan to remove > > > > Greame, it's the UDM plight ... killing all dead code really helps > > streamlining the API. > > Ah, I see - Well, I won't stand in the way of progress ;) Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery ;-) > > Regards, > > Graeme Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-27 23:56 ` Marek Vasut @ 2012-03-28 0:00 ` Graeme Russ 2012-03-28 0:17 ` Marek Vasut 0 siblings, 1 reply; 27+ messages in thread From: Graeme Russ @ 2012-03-28 0:00 UTC (permalink / raw) To: u-boot Marek, > Perfection is reached, not when there is no longer anything to add, but when > there is no longer anything to take away. > > ?-- Antoine de Saint-Exupery And: Not all that is simple is perfect. However, all that is perfect is simple -- Unkown :) ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-28 0:00 ` Graeme Russ @ 2012-03-28 0:17 ` Marek Vasut 0 siblings, 0 replies; 27+ messages in thread From: Marek Vasut @ 2012-03-28 0:17 UTC (permalink / raw) To: u-boot Dear Graeme Russ, > Marek, > > > Perfection is reached, not when there is no longer anything to add, but > > when there is no longer anything to take away. > > > > -- Antoine de Saint-Exupery > > And: > > Not all that is simple is perfect. However, all that is perfect is simple > > -- Unkown > > :) That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains. -- Steve Jobs ;-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 13:08 ` Wolfgang Denk 2012-03-26 13:31 ` Marek Vasut @ 2012-03-26 13:47 ` Viktor Křivák 2012-03-26 14:10 ` Anatolij Gustschin 2012-03-26 14:42 ` Timur Tabi 1 sibling, 2 replies; 27+ messages in thread From: Viktor Křivák @ 2012-03-26 13:47 UTC (permalink / raw) To: u-boot Dear Marek and Wolfgang, 2012/3/26 Wolfgang Denk <wd@denx.de>: > Dear Marek Vasut, > > In message <201203261243.19732.marex@denx.de> you wrote: >> >> > > I pretty sure because I try compile it without this driver and >> > > everything seems to be ok. >> > >> > In the given configurations, the BIOS code only gets built when you >> > the ATI Radeon support is enabled, in which case it is needed. >> > >> > If you don't enable either, then it's fine as well - but then the BIOS >> > code does not get built anyway. >> >> But we probably want this driver to work, so ... > > I'm not sure what your comment means. > > If you want to use this driver, then enable it in the configuration; > this will mean the BIOS emulator also gets built and linked, and it > will be needed to initialize the card's BIOS. > > Everything is fine. ?No problems anywhere. > > > What exactly was your concern? > I think here may be a little misunderstanding. I don't want to remove whole driver. I only want to remove support of bios emulator form that 2 board because I think they don't use it. I try compile it without this driver and everything seems to be ok. Best regards, Viktor Krivak ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 13:47 ` Viktor Křivák @ 2012-03-26 14:10 ` Anatolij Gustschin 2012-03-26 14:42 ` Timur Tabi 1 sibling, 0 replies; 27+ messages in thread From: Anatolij Gustschin @ 2012-03-26 14:10 UTC (permalink / raw) To: u-boot Hi Viktor, On Mon, 26 Mar 2012 15:47:57 +0200 Viktor K?iv?k <viktor.krivak@gmail.com> wrote: ... > > What exactly was your concern? > > > > I think here may be a little misunderstanding. I don't want to remove > whole driver. I only want to remove support of bios emulator form that > 2 board because I think they don't use it. I try compile it without > this driver and everything seems to be ok. BIOS emulator support is conditionally enabled on these boards, currently in mainline U-Boot it is deactivated as default. But at least on sequoia I used to activate it from time to time to test changes which may affect ATI video support. So please don't remove this optional BIOS emulator support. If you do not need it, just do not enable it in your board config file. Thanks, Anatolij ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 13:47 ` Viktor Křivák 2012-03-26 14:10 ` Anatolij Gustschin @ 2012-03-26 14:42 ` Timur Tabi 2012-03-26 20:17 ` Wolfgang Denk 1 sibling, 1 reply; 27+ messages in thread From: Timur Tabi @ 2012-03-26 14:42 UTC (permalink / raw) To: u-boot Viktor K?iv?k wrote: > I think here may be a little misunderstanding. I don't want to remove > whole driver. I only want to remove support of bios emulator form that > 2 board because I think they don't use it. I try compile it without > this driver and everything seems to be ok. I think it's okay to remove it from the P1022DS board. I think the only reason it is enabled because of some misunderstanding of the BSP requirement, and no one ever noticed. -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 27+ messages in thread
* [U-Boot] BIOS EMULATOR driver 2012-03-26 14:42 ` Timur Tabi @ 2012-03-26 20:17 ` Wolfgang Denk 0 siblings, 0 replies; 27+ messages in thread From: Wolfgang Denk @ 2012-03-26 20:17 UTC (permalink / raw) To: u-boot Dear Timur Tabi, In message <4F70804A.5030805@freescale.com> you wrote: > > > I think here may be a little misunderstanding. I don't want to remove > > whole driver. I only want to remove support of bios emulator form that > > 2 board because I think they don't use it. I try compile it without > > this driver and everything seems to be ok. > > I think it's okay to remove it from the P1022DS board. I think the only > reason it is enabled because of some misunderstanding of the BSP > requirement, and no one ever noticed. Please look at the code before posting. The "#define CONFIG_BIOSEMU" is in a block "#ifdef CONFIG_ATI", and when you enable support for an ATI card you most probably want to enable BIOS emu support as well. Everything is perfectly fine hre, nothing should be changed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Minds are like parachutes - they only function when open. ^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2012-03-28 0:17 UTC | newest] Thread overview: 27+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-03-25 17:23 [U-Boot] BIOS EMULATOR driver Viktor Křivák 2012-03-25 18:30 ` Wolfgang Denk 2012-03-25 23:09 ` Viktor Křivák 2012-03-26 5:51 ` Wolfgang Denk 2012-03-26 10:43 ` Marek Vasut 2012-03-26 13:08 ` Wolfgang Denk 2012-03-26 13:31 ` Marek Vasut 2012-03-26 20:14 ` Wolfgang Denk 2012-03-26 23:06 ` Marek Vasut 2012-03-27 5:18 ` Viktor Křivák 2012-03-27 17:28 ` Wolfgang Denk 2012-03-27 17:48 ` Marek Vasut 2012-03-27 17:51 ` Timur Tabi 2012-03-27 17:58 ` Marek Vasut 2012-03-27 17:59 ` Timur Tabi 2012-03-27 20:11 ` Marek Vasut 2012-03-27 22:46 ` Viktor Křivák 2012-03-27 22:56 ` Graeme Russ 2012-03-27 23:46 ` Marek Vasut 2012-03-27 23:51 ` Graeme Russ 2012-03-27 23:56 ` Marek Vasut 2012-03-28 0:00 ` Graeme Russ 2012-03-28 0:17 ` Marek Vasut 2012-03-26 13:47 ` Viktor Křivák 2012-03-26 14:10 ` Anatolij Gustschin 2012-03-26 14:42 ` Timur Tabi 2012-03-26 20:17 ` Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox