[Pdbg] [RFC 02/12] sbefifo: Rework the memory interfaces

Alistair Popple alistair at popple.id.au
Tue Aug 20 14:47:59 AEST 2019


> > diff --git a/p9-kernel.dts.m4 b/p9-kernel.dts.m4
> > index 9ab46b8..30cde95 100644
> > --- a/p9-kernel.dts.m4
> > +++ b/p9-kernel.dts.m4
> > @@ -28,6 +28,10 @@
> >  			index = <0x0>;
> >  			compatible = "ibm,kernel-sbefifo";
> >  			device-path = "/dev/sbefifo1";
> > +
> > +			sbefifo-mem at 0 {
> > +				      compatible = "ibm,sbefifo-mem";
> > +			};
> >  		};
> >  
> >  		hmfsi at 100000 {
> 
> Shouldn't we add sbefifo-mem at 1 (for sbefifo at 1) for completeness?

Yep, will repost a non-RFC version with that added.

- Alistair
 
> 
> > diff --git a/p9-pib.dts.m4 b/p9-pib.dts.m4
> > index 3e312e5..3a99157 100644
> > --- a/p9-pib.dts.m4
> > +++ b/p9-pib.dts.m4
> > @@ -36,11 +36,6 @@ reg = <0x0 HEX(CHIPLET_BASE($1)) 0xfffff>;
> >  }')dnl
> >  
> >  
> > -adu at 90000 {
> > -	  compatible = "ibm,power9-adu";
> > -	  reg = <0x0 0x90000 0x5>;
> > -};
> > -
> >  htm at 5012880 {
> >  	compatible = "ibm,power9-nhtm";
> >  	reg = <0x0 0x5012880 0x40>;
> > diff --git a/src/mem.c b/src/mem.c
> > index cacd394..53d33b8 100644
> > --- a/src/mem.c
> > +++ b/src/mem.c
> > @@ -95,23 +95,6 @@ static int _getmem(uint64_t addr, uint64_t size,
> > uint8_t block_size, bool ci, bo
> >  	buf = malloc(size);
> >  	assert(buf);
> >  
> > -	pdbg_for_each_class_target("sbefifo", target) {
> > -		if (pdbg_target_probe(target) != PDBG_TARGET_ENABLED)
> > -			continue;
> > -
> > -		pdbg_set_progress_tick(progress_tick);
> > -		progress_init();
> > -		rc = mem_read(target, addr, buf, size, block_size, ci);
> > -		progress_end();
> > -		if (rc) {
> > -			PR_ERROR("Unable to read memory using
> > sbefifo\n");
> > -			continue;
> > -		}
> > -
> > -		count++;
> > -		goto done;
> > -	}
> > -
> >  	pdbg_for_each_class_target("mem", target) {
> >  		if (pdbg_target_probe(target) != PDBG_TARGET_ENABLED)
> >  			continue;
> > @@ -121,15 +104,15 @@ static int _getmem(uint64_t addr, uint64_t
> > size, uint8_t block_size, bool ci, bo
> >  		rc = mem_read(target, addr, buf, size, block_size, ci);
> >  		progress_end();
> >  		if (rc) {
> > -			PR_ERROR("Unable to read memory using adu\n");
> > +			PR_ERROR("Unable to read memory from %s\n",
> > +				 pdbg_target_path(target));
> >  			continue;
> >  		}
> >  
> >  		count++;
> > -		goto done;
> > +		break;
> >  	}
> >  
> > -done:
> >  	if (count > 0) {
> >  		uint64_t i;
> >  		bool printable = true;
> > @@ -188,23 +171,6 @@ static int _putmem(uint64_t addr, uint8_t
> > block_size, bool ci)
> >  	buf = read_stdin(&buflen);
> >  	assert(buf);
> >  
> > -	pdbg_for_each_class_target("sbefifo", target) {
> > -		if (pdbg_target_probe(target) != PDBG_TARGET_ENABLED)
> > -			continue;
> > -
> > -		pdbg_set_progress_tick(progress_tick);
> > -		progress_init();
> > -		rc = mem_write(target, addr, buf, buflen, block_size,
> > ci);
> > -		progress_end();
> > -		if (rc) {
> > -			printf("Unable to write memory using
> > sbefifo\n");
> > -			continue;
> > -		}
> > -
> > -		count++;
> > -		goto done;
> > -	}
> > -
> >  	pdbg_for_each_class_target("mem", target) {
> >  		if (pdbg_target_probe(target) != PDBG_TARGET_ENABLED)
> >  			continue;
> > @@ -214,15 +180,15 @@ static int _putmem(uint64_t addr, uint8_t
> > block_size, bool ci)
> >  		rc = mem_write(target, addr, buf, buflen, block_size,
> > ci);
> >  		progress_end();
> >  		if (rc) {
> > -			printf("Unable to write memory using adu\n");
> > +			printf("Unable to write memory using %s\n",
> > +			       pdbg_target_path(target));
> >  			continue;
> >  		}
> >  
> >  		count++;
> > -		goto done;
> > +		break;
> >  	}
> >  
> > -done:
> >  	if (count > 0)
> >  		printf("Wrote %zu bytes starting at 0x%016" PRIx64
> > "\n", buflen, addr);
> >  
> 
> Amitay.
> 






More information about the Pdbg mailing list