diff mbox

Remove unused sms code.

Message ID 1457684692-23679-1-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth March 11, 2016, 8:24 a.m. UTC
There is currently only an unusable stub for the sms menu in SLOF.
It does not make much sense to parse this defunc code each time
we boot, that only wastes time and space in the boot rom image.
So let's simply remove these sms menu remainders for now.
Note: This patch also touches one line in OF.fs to make sure that
the dependencies for this file are properly regenerated (so we
avoid to force everybody to do a 'make distclean' afterwards).

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 board-qemu/slof/OF.fs    |   2 +-
 slof/fs/banner.fs        |   4 --
 slof/fs/base.fs          |   2 -
 slof/fs/packages/sms.fs  |  29 -----------
 slof/fs/sms/sms-load.fs  |  70 --------------------------
 slof/fs/sms/sms-nvram.fs | 124 -----------------------------------------------
 slof/fs/start-up.fs      |   3 --
 7 files changed, 1 insertion(+), 233 deletions(-)
 delete mode 100644 slof/fs/packages/sms.fs
 delete mode 100644 slof/fs/sms/sms-load.fs
 delete mode 100644 slof/fs/sms/sms-nvram.fs

Comments

Nikunj A Dadhania March 11, 2016, 9:15 a.m. UTC | #1
Thomas Huth <thuth@redhat.com> writes:

> There is currently only an unusable stub for the sms menu in SLOF.
> It does not make much sense to parse this defunc code each time
> we boot, that only wastes time and space in the boot rom image.
> So let's simply remove these sms menu remainders for now.
> Note: This patch also touches one line in OF.fs to make sure that
> the dependencies for this file are properly regenerated (so we
> avoid to force everybody to do a 'make distclean' afterwards).
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Nice cleanup, and js2x too does not need this ?

Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Thomas Huth March 11, 2016, 9:26 a.m. UTC | #2
On 11.03.2016 10:15, Nikunj A Dadhania wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
>> There is currently only an unusable stub for the sms menu in SLOF.
>> It does not make much sense to parse this defunc code each time
>> we boot, that only wastes time and space in the boot rom image.
>> So let's simply remove these sms menu remainders for now.
>> Note: This patch also touches one line in OF.fs to make sure that
>> the dependencies for this file are properly regenerated (so we
>> avoid to force everybody to do a 'make distclean' afterwards).
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
> 
> Nice cleanup, and js2x too does not need this ?

IIRC, js2x never used the sms menu - this was just in SLOF for QS21 and
QS22, thus it should be pretty save to remove these files nowadays.

 Thomas
Alexey Kardashevskiy March 16, 2016, 5:09 a.m. UTC | #3
On 03/11/2016 07:24 PM, Thomas Huth wrote:
> There is currently only an unusable stub for the sms menu in SLOF.
> It does not make much sense to parse this defunc code each time
> we boot, that only wastes time and space in the boot rom image.
> So let's simply remove these sms menu remainders for now.
> Note: This patch also touches one line in OF.fs to make sure that
> the dependencies for this file are properly regenerated (so we
> avoid to force everybody to do a 'make distclean' afterwards).
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Thanks, applied.
diff mbox

Patch

diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
index 69ee5c1..784f2bd 100644
--- a/board-qemu/slof/OF.fs
+++ b/board-qemu/slof/OF.fs
@@ -50,7 +50,7 @@  hex
 : mm-log-warning 2drop ;
 
 : write-mm-log ( data length type -- status )
-	3drop 0
+    3drop 0
 ;
 
 100 cp
diff --git a/slof/fs/banner.fs b/slof/fs/banner.fs
index efdba0c..d8bf406 100644
--- a/slof/fs/banner.fs
+++ b/slof/fs/banner.fs
@@ -12,12 +12,8 @@ 
 
 : banner
    cr ."   Type 'boot'  and press return  to  continue  booting  the system."
-   s" /packages/sms" find-node IF
-      cr ."   Type 'sms-start' and press return to enter the configuration menu."
-   THEN
    cr ."   Type 'reset-all'  and  press  return  to   reboot   the   system."
    cr cr
 ;
 
 : .banner banner console-clean-fifo ;
-
diff --git a/slof/fs/base.fs b/slof/fs/base.fs
index 03e77e5..79faaae 100644
--- a/slof/fs/base.fs
+++ b/slof/fs/base.fs
@@ -27,8 +27,6 @@ 
 VARIABLE mask -1 mask !
 
 VARIABLE huge-tftp-load 1 huge-tftp-load !
-\ Default implementation for sms-get-tftp-blocksize that return 1432 (decimal)
-: sms-get-tftp-blocksize 598 ;
 
 : default-hw-exception s" Exception #" type . ;
 
diff --git a/slof/fs/packages/sms.fs b/slof/fs/packages/sms.fs
deleted file mode 100644
index d8c672f..0000000
--- a/slof/fs/packages/sms.fs
+++ /dev/null
@@ -1,29 +0,0 @@ 
-\ *****************************************************************************
-\ * Copyright (c) 2004, 2008 IBM Corporation
-\ * All rights reserved.
-\ * This program and the accompanying materials
-\ * are made available under the terms of the BSD License
-\ * which accompanies this distribution, and is available at
-\ * http://www.opensource.org/licenses/bsd-license.php
-\ *
-\ * Contributors:
-\ *     IBM Corporation - initial implementation
-\ ****************************************************************************/
-
-
-s" /packages" find-device
-
-new-device
-   s" sms" device-name
-
-   : open true ;
-
-   : close ;
-
-   \ The rest of methods is loaded dynamically from the romfs
-   \ on a first call to sms-start
-
-finish-device
-
-device-end \ leave /packages
-
diff --git a/slof/fs/sms/sms-load.fs b/slof/fs/sms/sms-load.fs
deleted file mode 100644
index 8e4db80..0000000
--- a/slof/fs/sms/sms-load.fs
+++ /dev/null
@@ -1,70 +0,0 @@ 
-\ *****************************************************************************
-\ * Copyright (c) 2004, 2008 IBM Corporation
-\ * All rights reserved.
-\ * This program and the accompanying materials
-\ * are made available under the terms of the BSD License
-\ * which accompanies this distribution, and is available at
-\ * http://www.opensource.org/licenses/bsd-license.php
-\ *
-\ * Contributors:
-\ *     IBM Corporation - initial implementation
-\ ****************************************************************************/
-
-false VALUE (sms-loaded?)
-
-false value (sms-available?)
-
-s" sms.fs" romfs-lookup IF true to (sms-available?) drop THEN
-
-(sms-available?) [IF]
-
-#include "packages/sms.fs"
-
-\ Initialize SMS NVRAM handling.
-#include "sms-nvram.fs"
-
-\ Dynamically load sms code from the romfs file
-\ Assumption is that skeleton sms package already exists
-\ but aside of open & close, all other methods are in a romfs file (sms.fs)
-\ Here we open the package and load the rest of the functionality
-
-\ After that, one needs to find-device and execute sms-start method
-\ The shorthand for that is given as (global) sms-start word
-
-: $sms-node s" /packages/sms" ;
-
-: (sms-init-package) ( -- true|false )
-   (sms-loaded?) ?dup IF EXIT THEN
-   $sms-node ['] find-device catch IF 2drop false EXIT THEN
-   s" sms.fs" [COMPILE] included
-   device-end
-   true dup to (sms-loaded?)
-;
-
-\ External wrapper for sms package method
-: (sms-evaluate) ( addr len -- )
-   (sms-init-package) not IF
-      cr ." SMS is not available." cr 2drop exit
-   THEN
-
-   s" Entering SMS ..." type
-   disable-watchdog
-   reset-dual-emit
-
-   \ if we only had execute-device-method...
-   2>r $sms-node find-device
-   2r> evaluate
-   device-end
-   vpd-boot-import
-;
-
-: sms-start ( -- ) s" sms-start" (sms-evaluate) ;
-: sms-fru-replacement ( -- ) s" sms-fru-replacement" (sms-evaluate) ;
-
-[ELSE]
-
-: sms-start ( -- ) cr ." SMS is not available." cr ;
-: sms-fru-replacement ( -- ) cr ." SMS FRU replacement is not available." cr ;
-
-[THEN]
-
diff --git a/slof/fs/sms/sms-nvram.fs b/slof/fs/sms/sms-nvram.fs
deleted file mode 100644
index 4f5d6dd..0000000
--- a/slof/fs/sms/sms-nvram.fs
+++ /dev/null
@@ -1,124 +0,0 @@ 
-\ *****************************************************************************
-\ * Copyright (c) 2004, 2008 IBM Corporation
-\ * All rights reserved.
-\ * This program and the accompanying materials
-\ * are made available under the terms of the BSD License
-\ * which accompanies this distribution, and is available at
-\ * http://www.opensource.org/licenses/bsd-license.php
-\ *
-\ * Contributors:
-\ *     IBM Corporation - initial implementation
-\ ****************************************************************************/
-
-\ Initialize SMS NVRAM handling.
-
-: sms-init-nvram ( -- )
-   nvram-partition-type-sms get-nvram-partition IF
-      cr ." Could not find SMS partition in NVRAM - "
-      nvram-partition-type-sms s" SMS" d# 1024 new-nvram-partition
-      ABORT" Failed to create SMS NVRAM partition"
-      2dup erase-nvram-partition drop
-
-      2dup s" lang"			  s" 1" internal-set-env drop
-
-      2dup s" tftp-retries"		  s" 5" internal-set-env drop
-      2dup s" tftp-blocksize"		s" 512" internal-set-env drop
-      2dup s" bootp-retries"		s" 255" internal-set-env drop
-      2dup s" client"	    s" 000.000.000.000" internal-set-env drop
-      2dup s" server"       s" 000.000.000.000" internal-set-env drop
-      2dup s" gateway"      s" 000.000.000.000" internal-set-env drop
-      2dup s" netmask"      s" 255.255.255.000" internal-set-env drop
-      2dup s" net-protocol"		  s" 0" internal-set-env drop
-      2dup s" net-flags"		  s" 0" internal-set-env drop
-      2dup s" net-device"		  s" 0" internal-set-env drop
-      2dup s" net-client-name"		   s" " internal-set-env drop
-
-      2dup s" scsi-spinup"		  s" 6" internal-set-env drop
-      2dup s" scsi-id-0"		  s" 7" internal-set-env drop
-      2dup s" scsi-id-1"		  s" 7" internal-set-env drop
-      2dup s" scsi-id-2"		  s" 7" internal-set-env drop
-      2dup s" scsi-id-3"		  s" 7" internal-set-env drop
-      ." created" cr
-   THEN
-   s" sms-nvram-partition" $2constant
-;
-
-sms-init-nvram
-
-: sms-add-env ( "name" "value" -- ) sms-nvram-partition 2rot 2rot internal-add-env drop ;
-: sms-set-env ( "name" "value" -- ) sms-nvram-partition 2rot 2rot internal-set-env drop ;
-: sms-get-env ( "name" -- "value" TRUE | FALSE) sms-nvram-partition 2swap internal-get-env ;
-
-: sms-get-net-device ( -- n )	s" net-device" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
-: sms-set-net-device ( n -- )	(.d) s" net-device" 2swap sms-set-env ;
-
-: sms-get-net-flags ( -- n )	s" net-flags" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
-: sms-set-net-flags ( n -- )	(.d) s" net-flags" 2swap sms-set-env ;
-
-: sms-get-net-protocol ( -- n )	s" net-protocol" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
-: sms-set-net-protocol ( n -- )	(.d) s" net-protocol" 2swap sms-set-env ;
-
-: sms-get-lang ( -- n )	s" lang" sms-get-env IF $dnumber IF 1 THEN ELSE 1 THEN ;
-: sms-set-lang ( n -- )	(.d) s" lang" 2swap sms-set-env ;
-
-: sms-get-bootp-retries ( -- n ) s" bootp-retries" sms-get-env IF $dnumber IF 255 THEN ELSE 255 THEN ;
-: sms-set-bootp-retries ( n -- ) (.d) s" bootp-retries" 2swap sms-set-env ;
-
-: sms-get-tftp-retries ( -- n )	s" tftp-retries" sms-get-env IF $dnumber IF 5 THEN ELSE 5 THEN ;
-: sms-set-tftp-retries ( n -- ) (.d) s" tftp-retries" 2swap sms-set-env ;
-
-: sms-get-tftp-blocksize ( -- n ) s" tftp-blocksize" sms-get-env IF $dnumber IF 5 THEN ELSE 5 THEN ;
-: sms-set-tftp-blocksize ( n -- ) (.d) s" tftp-blocksize" 2swap sms-set-env ;
-
-: sms-get-client ( -- FALSE | n1 n2 n3 n4 TRUE ) s" client" sms-get-env IF (ipaddr) ELSE false THEN ;
-: sms-set-client ( n1 n2 n3 n4 -- ) (ipformat) s" client" 2swap sms-set-env ;
-
-: sms-get-server ( -- FALSE | n1 n2 n3 n4 TRUE ) s" server" sms-get-env IF (ipaddr) ELSE false THEN ;
-: sms-set-server ( n1 n2 n3 n4 -- ) (ipformat) s" server" 2swap sms-set-env ;
-
-: sms-get-gateway ( -- FALSE | n1 n2 n3 n4 TRUE ) s" gateway" sms-get-env IF (ipaddr) ELSE false THEN ;
-: sms-set-gateway ( n1 n2 n3 n4 -- ) (ipformat) s" gateway" 2swap sms-set-env ;
-
-: sms-get-subnet ( -- FALSE | n1 n2 n3 n4 TRUE ) s" netmask" sms-get-env IF (ipaddr) ELSE false THEN ;
-: sms-set-subnet ( n1 n2 n3 n4 -- ) (ipformat) s" netmask" 2swap sms-set-env ;
-
-: sms-get-client-name ( -- FALSE | addr len TRUE ) s" net-client-name" sms-get-env ;
-: sms-set-client-name ( addr len -- ) s" net-client-name" 2swap sms-set-env ;
-
-: sms-get-scsi-spinup ( -- n )	s" scsi-spinup" sms-get-env IF $dnumber IF 6 THEN ELSE 6 THEN ;
-: sms-set-scsi-spinup ( n -- )	(.d) s" scsi-spinup" 2swap sms-set-env ;
-
-: sms-get-scsi-id ( n -- id )	s" scsi-id-" rot (.) $cat sms-get-env IF $dnumber IF 6 THEN ELSE 6 THEN ;
-: sms-set-scsi-id ( id n -- ) swap (.d) rot s" scsi-id-" rot (.) $cat sms-set-env ;
-
-
-\ generates the boot-file part of the boot string
-
-: sms-get-net-boot-file ( -- addr len )
-   \ the format is
-   \ :[bootp,]siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries
-   \ we choose dhcp as a default!
-   s" net" sms-get-net-device (.) $cat
-   s" :dhcp," $cat
-   sms-get-server IF (ipformat) $cat THEN
-   s" ," $cat
-   sms-get-client-name IF $cat THEN
-   s" ," $cat
-   sms-get-client IF (ipformat) $cat THEN
-   s" ," $cat
-   sms-get-gateway IF (ipformat) $cat THEN
-   s" ," $cat
-   \ If the number of retries is 255 (max), assume default timeout (10min)
-   sms-get-bootp-retries dup ff <> IF (.) $cat ELSE drop THEN
-   s" ," $cat
-   sms-get-tftp-retries (.) $cat
-   \ now write the string to the boot path
-   dup IF
-      \ This could be considered a memory leak, but it is only
-      \ executed once for booting so it is not a problem
-      strdup ( s" :" 2swap $cat strdup )
-   THEN
-;
-
-' sms-get-net-boot-file to furnish-boot-file
-
diff --git a/slof/fs/start-up.fs b/slof/fs/start-up.fs
index f1488fa..fb88f76 100644
--- a/slof/fs/start-up.fs
+++ b/slof/fs/start-up.fs
@@ -62,9 +62,6 @@ 
 ;
 
 
-#include "sms/sms-load.fs"
-
-
 \ Watchdog will be rearmed during load if use-load-watchdog variable is TRUE
 TRUE VALUE use-load-watchdog?