The previous code does not work for bus width larger than 128 bits. This
patch replace the limited test cases, and should work without bus width
limitation.

Signed-off-by: Thomas Chou <[EMAIL PROTECTED]>
---
 .../nios2nommu/scripts/PTF/SystemPTF/Module.pm     |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/linux-2.6.x/arch/nios2nommu/scripts/PTF/SystemPTF/Module.pm 
b/linux-2.6.x/arch/nios2nommu/scripts/PTF/SystemPTF/Module.pm
index 48d246b..0036c36 100644
--- a/linux-2.6.x/arch/nios2nommu/scripts/PTF/SystemPTF/Module.pm
+++ b/linux-2.6.x/arch/nios2nommu/scripts/PTF/SystemPTF/Module.pm
@@ -168,21 +168,8 @@ sub getSize {
        my $data_width = $SBI->getAssignment ('Data_Width');
        my $addr_width = $SBI->getAssignment ('Address_Width');
        
-       if ($data_width == 8) {
-               $size = 1 << $addr_width;
-       } elsif ($data_width == 16) {
-               $size = 1 << ($addr_width + 1);
-       } elsif ($data_width == 32) {
-               $size = 1 << ($addr_width + 2);
-       } elsif ($data_width == 64) {
-               $size = 1 << ($addr_width + 3);
-       } elsif ($data_width == 128) {
-               $size = 1 << ($addr_width + 4);
-       } else {
-               return;
-       }
-       
-       $size_text = sprintf ("%#010x", $size);
+       my $size = (1 << $addr_width) * ($data_width / 8);
+       my $size_text = sprintf ("%#010x", $size);
        return $size_text;
 }
 
-- 
1.5.3.3

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to